Project

General

Profile

Actions

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

Added by Nicolas PERRON over 11 years ago. Updated almost 10 years ago.

Status:
Released
Priority:
1 (highest)
Assignee:
Nicolas PERRON
Category:
Packaging
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

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.


Related issues 4 (0 open4 closed)

Related to Rudder - Bug #3976: Since add of a new file to check CFEngine processes and Rudder UUID (#3925), the patch for Debian 5 (about tokyocabinet) does not work anymore for debian/rulesReleasedNicolas PERRON2013-10-01Actions
Related to Rudder - Architecture #9860: Do not create a temporary cron a postinstallReleasedAlexis Mousset2016-12-28Actions
Has duplicate Rudder - Bug #3962: missing uuid.hive is not restored on centosRejectedMatthieu CERDA2013-09-24Actions
Blocks Rudder - Architecture #3930: Rudder-agent cron file now use check-rudder-agent script (/opt/rudder/bin/check-rudder-agent)ReleasedMatthieu CERDA2013-09-17Actions
Actions #1

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?

Actions #2

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.

Actions #3

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.

Actions #4

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.
Actions #5

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.

Actions #6

Updated by Jonathan CLARKE over 11 years ago

  • Status changed from Pending technical review to Discussion
  • Assignee changed from Jonathan CLARKE to Nicolas PERRON
Actions #7

Updated by Nicolas PERRON over 11 years ago

  • Status changed from Discussion to Pending technical review
  • Assignee changed from Nicolas PERRON to Jonathan CLARKE
Actions #8

Updated by Nicolas PERRON over 11 years ago

Pull Request updated.
It will be possible to merge #3939 and #3930 after this issue is fixed.

Actions #9

Updated by Nicolas PERRON over 11 years ago

What we've dediced is:
  • 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 ?

Actions #10

Updated by Nicolas PERRON over 11 years ago

  • Status changed from Pending technical review to Pending release

Applied in changeset commit:530939f77357e20ea1da2b6414a288dfaab3baef.

Actions #11

Updated by Nicolas PERRON over 11 years ago

Applied in changeset commit:d4d3097ee9d4714c87efe9bbe22ab0dc014052f0.

Actions #12

Updated by Jonathan CLARKE over 11 years ago

Applied in changeset commit:01b3b42aca470c9f2b15018ae3065e1618c9e951.

Actions #13

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)

Actions #14

Updated by Matthieu CERDA about 11 years ago

Pull request reverted, I'm fixing this again.

Actions #15

Updated by Matthieu CERDA about 11 years ago

  • Assignee changed from Jonathan CLARKE to Matthieu CERDA
Actions #16

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.

Actions #17

Updated by Matthieu CERDA about 11 years ago

  • Assignee changed from Jonathan CLARKE to Nicolas CHARLES
Actions #18

Updated by Matthieu CERDA about 11 years ago

  • Status changed from Pending technical review to Pending release

Applied in changeset commit:a01181b20a0f08700f5cfaae6a483f4ef2813aeb.

Actions #19

Updated by Nicolas CHARLES about 11 years ago

Applied in changeset commit:a4ac7e29549f27c7c650cb49cf3eda8b0a428a50.

Actions #20

Updated by Nicolas PERRON about 11 years ago

This bug has been fixed in Rudder 2.4.9, which was released today.
Check out:

Actions #21

Updated by Nicolas PERRON about 11 years ago

  • Status changed from Pending release to Released
Actions #22

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'

Actions #23

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

Actions #24

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

Actions #25

Updated by Nicolas PERRON about 11 years ago

  • Status changed from In progress to Pending technical review
Actions #26

Updated by Nicolas PERRON about 11 years ago

  • Status changed from Pending technical review to Released
Actions #27

Updated by Benoît PECCATTE almost 10 years ago

  • Project changed from 34 to Rudder
  • Category set to Packaging
Actions #28

Updated by Benoît PECCATTE almost 8 years ago

Actions

Also available in: Atom PDF