Bug #3925
closed/opt/rudder/etc/uuid.hive is removed if the package rudder-agent is upgrade from 2.4.8, 2.6.4, 2.6.5, 2.7.1 or 2.7.2 on SuSE or RHEL/CentOS
Description
The package rudder-agent will remove the file uuid.hive on RHEL/CentOS or SuSE if the package is upgrade from 2.4.8, 2.6.4, 2.6.5, 2.7.1 or 2.7.2.
To prevent this, we should use a postinst script which will replace the uuid.hive file from a backup.
Updated by Nicolas PERRON over 11 years ago
- Status changed from New to Pending technical review
- Assignee changed from Nicolas PERRON to Jonathan CLARKE
- % Done changed from 0 to 100
- Pull Request set to https://github.com/Normation/rudder-packages/pull/119
Pull Request URL added: https://github.com/Normation/rudder-packages/pull/119
Jon, could you review it please?
Updated by Jonathan CLARKE over 11 years ago
- Status changed from Pending technical review to Discussion
- Assignee changed from Jonathan CLARKE to Nicolas PERRON
Nicolas, I can't review this, because I don't understand what you're trying to do, and how it fits into other recent changes.
I recall that we added a backup mechanism recently to save uuid.hive on package uninstalls and upgrades. How does this change fit in with this? Could you explain and link to the related issue please?
Also, what is the cause that means this happens on 2.4.8, 2.6.4, 2.6.5, 2.7.1 and 2.7.2 only?
Put simply, please explain the context around this.
Updated by Nicolas PERRON over 11 years ago
- Assignee changed from Nicolas PERRON to Jonathan CLARKE
Jonathan CLARKE wrote:
Nicolas, I can't review this, because I don't understand what you're trying to do, and how it fits into other recent changes.
I recall that we added a backup mechanism recently to save uuid.hive on package uninstalls and upgrades. How does this change fit in with this? Could you explain and link to the related issue please?
Also, what is the cause that means this happens on 2.4.8, 2.6.4, 2.6.5, 2.7.1 and 2.7.2 only?
Put simply, please explain the context around this.
During upgrade, the previous version of pre/postuninstall is used which leads rudder-agent from the released versions 2.4.8, 2.6.4, 2.6.5, 2.7.1 and 2.7.2 to remove their /opt/rudder/etc/uuid.hive file because of #3634 et #3896.
#3915 will prevent the packages before 2.6.4, 2.6.5, 2.7.1 and 2.7.2 to remove /opt/rudder/etc/uuid.hive as the rudder-agent of these version does not contain #3634 et #3896.
This fix will replace "no uuid during upgrade" by the latest backuped one or by a new one.
Updated by Nicolas PERRON over 11 years ago
- Status changed from Discussion to 8
- Assignee changed from Jonathan CLARKE to Nicolas PERRON
This is more complex than expected. With Jon, we had a discussion because of the ordering of the pre/post script during upgrade. Indeed, as said in #3915 the order is:
[...] 1. Run the %pre section of the RPM being installed. 2. Install the files that the RPM provides. 3. Run the %post section of the RPM. 4. Run the %preun of the old package. 5. Delete any old files not overwritten by the newer version. (This step deletes files that the new package does not require.) 6. Run the %postun hook of the old package. [...]So what we have decided is:
- Move the check of UUID to a shared file.
- Move the logic of the cron to a shared file.
- Install the shared file by rudder-agent package.
- Postinst of a package installed after rudder-agent (rudder-server-root seems to be a good candidate) should launch the shared file (in order to fix the issue of this ticket)
- Change logic of the cron to call the shared file: Update the system Techniques in order to modify /etc/cron.d/rudder-agent.
Updated by Nicolas PERRON over 11 years ago
- Status changed from 8 to Pending technical review
- Assignee changed from Nicolas PERRON to Jonathan CLARKE
Pull Request updated. Jon, could you review it please ?
If validated, it will request another ticket to modify the cron entry.
Updated by Jonathan CLARKE over 11 years ago
- Status changed from Pending technical review to Discussion
- Assignee changed from Jonathan CLARKE to Nicolas PERRON
Updated by Nicolas PERRON over 11 years ago
- Status changed from Discussion to Pending technical review
- Assignee changed from Nicolas PERRON to Jonathan CLARKE
Updated by Nicolas PERRON over 11 years ago
Updated by Nicolas PERRON over 11 years ago
- Changing /etc/cron.d/rudder-agent is a too big change for old/stable releases. It will be changed into Rudder 2.8 (need to retarget #3930)
- All other versions of Rudder will use a temporary cron file /etc/cron.d/rudder-agent-uuid (seems good with #3925 and #3939) to fix the issue of this ticket
Do you agree, Jon ?
Updated by Nicolas PERRON over 11 years ago
- Status changed from Pending technical review to Pending release
Applied in changeset commit:530939f77357e20ea1da2b6414a288dfaab3baef.
Updated by Nicolas PERRON over 11 years ago
Applied in changeset commit:d4d3097ee9d4714c87efe9bbe22ab0dc014052f0.
Updated by Jonathan CLARKE over 11 years ago
Applied in changeset commit:01b3b42aca470c9f2b15018ae3065e1618c9e951.
Updated by Nicolas CHARLES about 11 years ago
- Status changed from Pending release to In progress
Ok, this fix doesn't work on Centos ...
Cron complains that
Sep 24 18:53:37 server crond[24395]: (root) BAD FILE MODE (/etc/cron.d/rudder-agent-uuid)
Updated by Matthieu CERDA about 11 years ago
Pull request reverted, I'm fixing this again.
Updated by Matthieu CERDA about 11 years ago
- Assignee changed from Jonathan CLARKE to Matthieu CERDA
Updated by Matthieu CERDA about 11 years ago
- Status changed from In progress to Pending technical review
- Assignee changed from Matthieu CERDA to Jonathan CLARKE
- Pull Request changed from https://github.com/Normation/rudder-packages/pull/119 to https://github.com/Normation/rudder-packages/pull/127
PR updated with an extra fix.
Updated by Matthieu CERDA about 11 years ago
- Assignee changed from Jonathan CLARKE to Nicolas CHARLES
Updated by Matthieu CERDA about 11 years ago
- Status changed from Pending technical review to Pending release
Applied in changeset commit:a01181b20a0f08700f5cfaae6a483f4ef2813aeb.
Updated by Nicolas CHARLES about 11 years ago
Applied in changeset commit:a4ac7e29549f27c7c650cb49cf3eda8b0a428a50.
Updated by Nicolas PERRON about 11 years ago
This bug has been fixed in Rudder 2.4.9, which was released today.
Check out:
- The release announcement: http://www.rudder-project.org/pipermail/rudder-announce/2013-October/000049.html
- The full ChangeLog: http://www.rudder-project.org/foswiki/bin/view/System/Documentation:ChangeLog24
- Download information: http://www.rudder-project.org/foswiki/Download/
Updated by Nicolas PERRON about 11 years ago
- Status changed from Pending release to Released
Updated by Nicolas CHARLES about 11 years ago
- Status changed from Released to In progress
- Assignee changed from Nicolas CHARLES to Nicolas PERRON
Actually, this is not fixed; it cannot find the existing backup of the uuid.hive, due to a sad typo
I'm reopening the ticket
Here is what happens
bash -x /opt/rudder/bin/check-rudder-agent + set -e + BACKUP_DIR=/var/backups/rudder/ ++ whoami + '[' '!' root = root ']' + check_and_fix_rudder_uuid + UUID_FILE=/opt/rudder/etc/uuid.hive + LATEST_BACKUPED_UUID= + '[' '!' -e /opt/rudder/etc/uuid.hive ']' + '[' -d /var/backups/rudder/ ']' ++ tail -n1 ++ ls -v1 /var/backups/rudder/uuid-20131007.hive + LATEST_BACKUPED_UUID=/var/backups/rudder/uuid-20131007.hive + '[' -f /var/backups/rudder//var/backups/rudder/uuid-20131007.hive ']' + echo -n 'WARNING: The UUID of the node does not exist and no backup exist. A new one will be generated...' WARNING: The UUID of the node does not exist and no backup exist. A new one will be generated...+ uuidgen + echo ' Done'
Updated by Nicolas PERRON about 11 years ago
Nicolas CHARLES wrote:
Actually, this is not fixed; it cannot find the existing backup of the uuid.hive, due to a sad typo
It's not due to a sad typo but by the change of the output expected by #3995
I'm reopening the ticket
Here is what happens
[...]
I will fix it ASAP
Updated by Nicolas PERRON about 11 years ago
Nicolas PERRON wrote:
Nicolas CHARLES wrote:
Actually, this is not fixed; it cannot find the existing backup of the uuid.hive, due to a sad typo
It's not due to a sad typo but by the change of the output expected by #3995
I'm reopening the ticket
Here is what happens
[...]I will fix it ASAP
New ticket opened here: #3999
Updated by Nicolas PERRON about 11 years ago
- Status changed from In progress to Pending technical review
Updated by Nicolas PERRON about 11 years ago
- Status changed from Pending technical review to Released
Updated by Benoît PECCATTE almost 10 years ago
- Project changed from 34 to Rudder
- Category set to Packaging
Updated by Benoît PECCATTE almost 8 years ago
- Related to Architecture #9860: Do not create a temporary cron a postinstall added