Project

General

Profile

Actions

Bug #4098

closed

Rudder-agent upgrade fails if one of the binaries is in use during upgrade

Added by Nicolas CHARLES about 11 years ago. Updated about 11 years ago.

Status:
Released
Priority:
1 (highest)
Assignee:
Jonathan CLARKE
Category:
-
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

Description

On a Debian6, upgrading to 2.8 beta fails, because the file /var/rudder/cfengine-community/bin/cf-execd is busy

Here is the output of the update

Building dependency tree       
Reading state information... Done
The following packages will be upgraded:
  rudder-agent
1 upgraded, 0 newly installed, 0 to remove and 66 not upgraded.
Need to get 21.0 MB of archives.
After this operation, 1,012 kB disk space will be freed.
Get:1 http://www.rudder-project.org/apt-2.8/ squeeze/main rudder-agent amd64 2.8.0~beta1-squeeze0 [21.0 MB]
Fetched 21.0 MB in 18s (1,156 kB/s)                                                                                                                                              
(Reading database ... 33837 files and directories currently installed.)
Preparing to replace rudder-agent 2.6.8-squeeze0 (using .../rudder-agent_2.8.0~beta1-squeeze0_amd64.deb) ...
INFO: A back up copy of the /opt/rudder/etc/uuid.hive has been created in /var/backups/rudder
INFO: A back up copy of the /var/rudder/cfengine-community/ppkeys has been created in /var/backups/rudder
Unpacking replacement rudder-agent ...
Setting up rudder-agent (2.8.0~beta1-squeeze0) ...
Installing new version of config file /etc/init.d/rudder-agent ...
Making sure that the permissions on the CFEngine key directory are correct...
rudder-agent[13056]: [INFO] Using /etc/default/rudder-agent for configuration
rudder-agent[13059]: [INFO] Using /var/rudder/cfengine-community for CFEngine workdir
rudder-agent[13060]: [INFO] Halting CFEngine Community cf-serverd...
rudder-agent[13064]: [OK] CFEngine Community cf-serverd stopped after 2 seconds
rudder-agent[13065]: [INFO] Halting CFEngine Community cf-execd...
rudder-agent[13069]: [OK] CFEngine Community cf-execd stopped after 2 seconds
cp: cannot create regular file `/var/rudder/cfengine-community/bin/cf-execd': Text file busy
dpkg: error processing rudder-agent (--configure):
 subprocess installed post-installation script returned error exit status 1
configured to not write apport reports
                                      Errors were encountered while processing:
 rudder-agent
E: Sub-process /usr/bin/dpkg returned an error code (1)

executing a second time the command still fails :(

Building dependency tree       
Reading state information... Done
rudder-agent is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 66 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? Y
Setting up rudder-agent (2.8.0~beta1-squeeze0) ...
Making sure that the permissions on the CFEngine key directory are correct...
rudder-agent[13123]: [INFO] Using /etc/default/rudder-agent for configuration
rudder-agent[13126]: [INFO] Using /var/rudder/cfengine-community for CFEngine workdir
rudder-agent[13127]: [INFO] Halting CFEngine Community cf-serverd...
rudder-agent[13128]: [INFO] can't read PID file, not stopping cf-serverd
rudder-agent[13129]: [INFO] Halting CFEngine Community cf-execd...
rudder-agent[13130]: [INFO] can't read PID file, not stopping cf-execd
rudder-agent[13136]: [INFO] Found no CFEngine Community cf-serverd processes running
rudder-agent[13143]: [INFO] Killing CFEngine Community cf-execd with force...
rudder-agent[13145]: [OK] all CFEngine Community cf-execd processes killed with force
CFEngine binaries copied to workdir
rudder-agent[13157]: [INFO] Using /etc/default/rudder-agent for configuration
rudder-agent[13160]: [INFO] Using /var/rudder/cfengine-community for CFEngine workdir
rudder-agent[13161]: [ALERT] The /opt/rudder/etc/disable-agent flag file is present. The agent cannot be started.
dpkg: error processing rudder-agent (--configure):
 subprocess installed post-installation script returned error exit status 3
configured to not write apport reports
                                      Errors were encountered while processing:
 rudder-agent
E: Sub-process /usr/bin/dpkg returned an error code (1)


Related issues 1 (0 open1 closed)

Related to Rudder - Bug #3665: Upgrade rudder-agent through rudder-agent fails due to "Text file busy" on cpReleasedMatthieu CERDA2013-06-21Actions
Actions #1

Updated by Jonathan CLARKE about 11 years ago

The second error here was fixed in #4087. So, now, if this happens and you try again, it should work.

However, the original error is suprising, because cf-execd was stopped, but then the systems considers it busy... This is similar to #3665.

Actions #2

Updated by Jonathan CLARKE about 11 years ago

  • Category deleted (13)
Actions #3

Updated by Jonathan CLARKE about 11 years ago

  • Status changed from New to 8

There looks to be a simple workaround for this, according to http://lists.freebsd.org/pipermail/freebsd-current/2003-September/009972.html and http://lists.freebsd.org/pipermail/freebsd-current/2003-September/009972.html : use cp -f, instead of just cp.

I can't see this doing any harm, since we're upgrading the agent anyway - if it fails, we will run the cp again. It might be more risky for #3665, which is about rudder-agent upgrading itself (via a promise), but that doesn't work now, so we'll soon see if this fixes it.

Matthieu, can you implement this trivial fix please?

Actions #4

Updated by Jonathan CLARKE about 11 years ago

  • Target version changed from 2.8.0~rc1 to 2.4.12

My guess is that this is to be fixed in 2.4. Please check.

Please also mention "Fixes #4098, #3665: " in your commit message.

Actions #5

Updated by Vincent MEMBRÉ about 11 years ago

  • Status changed from 8 to In progress
  • Assignee changed from Matthieu CERDA to Vincent MEMBRÉ

I'm taking this!

Actions #6

Updated by Vincent MEMBRÉ about 11 years ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Vincent MEMBRÉ to Jonathan CLARKE
  • Pull Request set to https://github.com/Normation/rudder-packages/pull/167
Actions #7

Updated by Vincent MEMBRÉ about 11 years ago

  • Status changed from Pending technical review to Pending release
  • % Done changed from 0 to 100

Applied in changeset packages:commit:4918b3c7505ece65979297e485eb9a4fa1469175.

Actions #8

Updated by Jonathan CLARKE about 11 years ago

Applied in changeset packages:commit:4c2663abdf304540c739b911e1cc0eed24307e66.

Actions #9

Updated by Vincent MEMBRÉ about 11 years ago

  • Subject changed from Upgrading rudder-agent from 2.6.8 to 2.8beta fails on Debian to Rudder-agent upgrade fails if one of the binaries is in use during upgrade
Actions #10

Updated by Nicolas PERRON about 11 years ago

  • Status changed from Pending release to Released

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

Actions

Also available in: Atom PDF