Bug #4387
closed
Upgrade rudder-agent can fail if cf-serverd/cf-execd fails to stop gracefully
Added by Dennis Cabooter almost 11 years ago.
Updated over 9 years ago.
Description
While upgrading rudder-server-root 2.9.1 to 2.9.2 on Ubuntu 12.04 LTS the following happened:
rudder-agent[11400]: [ALERT] cf-serverd still running (PID 19426), try: /etc/init.d/rudder-agent forcestop
dpkg: error processing rudder-agent (--configure): subprocess installed post-installation script returned error exit status 1
I waited for the install to finish, then killed all cf- processes and did a "apt-get -f install". The installation upgraded rudder-agent. However, rudder-agent didn't start, because of this:
rudder-agent[19222]: [ALERT] The /opt/rudder/etc/disable-agent flag file is present. The agent cannot be started.
I saw this because I did a "/etc/init.d/rudder-server-root restart". I did that because all nodes had No Answer reports and all compliances were on 0%.
- Assignee set to Matthieu CERDA
- Priority changed from N/A to 1 (highest)
Rudder-agent should not fail during upgrade, or at least should not keep the disable-agent file.
Maybe we could use forcestop instead of stop in the upgrade process.
Is there a way to have a "clean" process when an upgrade fail ? So that we could delete disable-agent if the file is present in case of failure.
- Status changed from New to 8
Vincent MEMBRÉ wrote:
Rudder-agent should not fail during upgrade, or at least should not keep the disable-agent file.
Maybe we could use forcestop instead of stop in the upgrade process.
I suggest:
/etc/init.d/rudder-agent stop || /etc/init.d/rudder-agent forcestop
Is there a way to have a "clean" process when an upgrade fail ? So that we could delete disable-agent if the file is present in case of failure.
Not easily. But we could use the same approach as above:
/etc/init.d/rudder-agent stop || /etc/init.d/rudder-agent forcestop || rm -f /opt/rudder/etc/disable-agent
Caution, with this approach
/etc/init.d/rudder-agent stop || /etc/init.d/rudder-agent forcestop || rm -f /opt/rudder/etc/disable-agent
if the file /opt/rudder/etc/disable-agent was there before upgrading, we shouldn't remove it
I'm not a Rudder dev, but is the Rudder server not completely useless with /opt/rudder/etc/disable-agent in place? I would remove it anyway.
- Target version changed from 2.9.3 to 2.9.4
- Target version changed from 2.9.4 to 2.9.5
- Target version changed from 2.9.5 to 2.9.6
- Target version changed from 2.9.6 to 2.9.7
- Target version changed from 2.9.7 to 150
- Target version changed from 150 to 2.10.4
- Target version changed from 2.10.4 to 2.10.5
- Project changed from Rudder to 34
- Subject changed from Upgrade rudder-server-root 2.9.1 to 2.9.2 fails on rudder-agent on Ubuntu 12.04 LTS to Upgrade rudder-agent can fail if cf-serverd/cf-execd fails to stop gracefully
- Status changed from 8 to Pending technical review
- Assignee changed from Matthieu CERDA to Benoît PECCATTE
- Target version changed from 2.10.5 to 2.6.18
- Pull Request set to https://github.com/Normation/rudder-packages/pull/462
Let's start with the simple approach of ```/etc/init.d/rudder-agent stop || /etc/init.d/rudder-agent forcestop```. This should solve any cases where this fails.
If we still need to clean up the flag we left after that, we'll see about how to do that if it turns out to be necessary.
- Status changed from Pending technical review to Pending release
- % Done changed from 0 to 100
Applied in changeset commit:ea727140ee6b319ea34d86829df36f2b64c567ed.
Applied in changeset commit:97d9137d8544004edef0ea67ec41f94d63755a8a.
- Status changed from Pending release to Released
This bug has been fixed in Rudder 2.6.18, which was released today.
Check out:
- Project changed from 34 to Rudder
- Category set to Packaging
Also available in: Atom
PDF