The symbolic link nodeinit.conf is created by the postinistall scripts to point to the correct file (either nodeinit.conf.controller or nodeinit.conf.payload). An RPM installation will create the link, and an RPM uninstallation will remove the link. An RPM upgrade does not toch the link.
The problem is that the symbolic link nodeinit.conf is also listed in the %files section of the opensaf RPM. This means that when the RPM is upgraded, the nodeinit.conf created by the postinstall script will be overwritten to always point to nodeinit.conf.controller, on both controller and payload nodes. The solution is to remove the symbolic link from the %files section.
I would like the symlinks to be removed completely from packaging. NID should be able to open the correct file using the contents of node_type as file suffix
By any chance, the node which is upgrading to PLD is a CTRL node currently?
Wondering how the softlink to controller can exist on PLD and what is the guarantee that node_type(noreplace) will have the right update.
No, the problem happens when a payload is upgraded, and it should still be a payload afterwards. But the symbolic link gets overwritten to point to nodeinit.conf.controller. This happens because the symbolic link is included in the RPM package (listed in the %files section) but not touched by the postinstall scripts during an upgrade.
Removing the softlink from %files section will not help, it will lead to other error like "file installed, but not packaged".
This is a tricky one.
This patch should help. The symlink changes in the patch is not related to this ticket, but does increases the robustness of the spec file.
Note that using the node_type instead of softlinks have been contemplated many times in the past, but i think to stop packaging nodeinit.conf might in-itself create upgrade problems. Got to pursue it in 4.4
Final tested patch (without symlink changes)
Two patches have been sent for review.
The patch for the 4.2.x and 4.3.x maintenance branch fix the bug such that softlink is created when user uses rpm -Uvh.
The second patch is for 4.4 and it changes the user interface i.e. the nodeinit.conf softlink is avoided and the file will also not packaged. OpenSAF startup reads the node_type value.
From 4.4 onwards, nodeinit.conf softlink is deprecated. User can modify the nodeinit.conf.controller and nodeinit.conf.payload for NID onfiguration files for controller and payload rpm packages accordingly. OpenSAF startup reads the /etc/opensaf/node_type file and accordingly reads the nodeinit.conf.<node_type> file.</node_type>
When user does a make install, by default opensaf is setup for controller, i.e. node_type will be set to 'controller'. User has to change this to 'payload' if the user wishes to change it configure the opensaf as a payload.
changeset: 4320:746c76041302
branch: opensaf-4.2.x
parent: 4317:7d726fdf6978
user: mathi.naickan@oracle.com
date: Thu Jun 27 12:51:27 2013 +0530
summary: osaf: update nodeinit.conf softlink during rpm -Uvh [281]
changeset: 4321:5eda40762ad8
branch: opensaf-4.3.x
parent: 4318:40048d531c0e
user: mathi.naickan@oracle.com
date: Thu Jun 27 12:59:25 2013 +0530
summary: osaf: update nodeinit.conf softlink during rpm -Uvh [281]
changeset: 4322:7e6d141c36db
tag: tip
parent: 4319:df0acc9fa78b
user: mathi.naickan@oracle.com
date: Thu Jun 27 13:08:02 2013 +0530
summary: osaf: remove nodeinit.conf softlink and from packaging [281]
Correction ..."accordingly reads the nodeinit.conf.node_type file".