Project

General

Profile

Actions

Bug #3634

closed

The Rudder agent post installation and removal scripts are not cleaning things correctly

Added by Dennis Cabooter over 9 years ago. Updated almost 8 years ago.

Status:
Released
Priority:
2
Assignee:
Matthieu CERDA
Category:
Packaging
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Regression:

Description

The install message on RHEL nodes is as follows:

********************************************************************************
rudder-agent has been installed (not started). This host can be a Rudder node.
To get started, configure your Rudder server's hostname and launch the agent:
# echo 'rudder.server' > /var/rudder/cfengine-community/policy_server.dat
# service rudder-agent start
This node will then appear in the Rudder web interface under 'Accept new nodes'.
********************************************************************************

However, on RHEL a service is immediatly started after an install. So it should say "service rudder-agent restart".


Related issues 3 (0 open3 closed)

Related to Rudder - Bug #3636: No Answer status with multiple instanced of cfexecd RejectedMatthieu CERDA2013-06-05Actions
Related to Rudder - Bug #3602: With RPM, if we uninstall rudder-agent and reinstall it, the file /opt/rudder/etc/uuid.hive will be replaced by another oneRejectedNicolas PERRON2013-05-21Actions
Related to Rudder - Bug #3896: The postrm script of Rudder-agent removes too much filesReleasedJonathan CLARKE2013-08-30Actions
Actions #1

Updated by Nicolas PERRON over 9 years ago

  • Status changed from New to Discussion
  • Assignee set to Dennis Cabooter

I'm not sure that it's necessary since after a test i've got this:

[root@server ~]# yum install rudder-agent
[...]

********************************************************************************
rudder-agent has been installed (not started). This host can be a Rudder node.
To get started, configure your Rudder server's hostname and launch the agent:
# echo 'rudder.server' > /var/rudder/cfengine-community/policy_server.dat
# service rudder-agent start
This node will then appear in the Rudder web interface under 'Accept new nodes'.
********************************************************************************
Making a key pair for cfengine, please wait, this could take a minute...
  Verifying  : 1398866025:rudder-agent-2.6.1.release-1.EL.6.x86_64                                                                                                                                                                 1/2 
  Verifying  : tokyocabinet-1.4.33-6.el6.x86_64                                                                                                                                                                                    2/2 

Installed:
  rudder-agent.x86_64 1398866025:2.6.1.release-1.EL.6                                                                                                                                                                                  

Dependency Installed:
  tokyocabinet.x86_64 0:1.4.33-6.el6                                                                                                                                                                                                   

Complete!
[root@server ~]# 
[root@server ~]# ps axf | grep cf
  933 ?        Ss     0:00 /sbin/dhclient -1 -q -cf /etc/dhcp/dhclient-eth0.conf -lf /var/lib/dhclient/dhclient-eth0.leases -pf /var/run/dhclient-eth0.pid eth0
 2033 pts/0    S+     0:00                      \_ grep cf

[root@server ~]#  service rudder-agent start
rudder-agent[2047]: [INFO] Using /etc/default/rudder-agent for configuration
rudder-agent[2050]: [INFO] Using /var/rudder/cfengine-community for CFEngine workdir
rudder-agent[2051]: [INFO] Launching CFEngine Community cf-serverd...
rudder-agent[2070]: [OK] CFEngine Community cf-serverd started after 1 seconds
rudder-agent[2071]: [INFO] Launching CFEngine Community cf-execd...
rudder-agent[2080]: [OK] CFEngine Community cf-execd started after 1 seconds

[root@server ~]# ps axf | grep cf
  933 ?        Ss     0:00 /sbin/dhclient -1 -q -cf /etc/dhcp/dhclient-eth0.conf -lf /var/lib/dhclient/dhclient-eth0.leases -pf /var/run/dhclient-eth0.pid eth0
 2085 pts/0    S+     0:00                      \_ grep cf
 2067 ?        Ss     0:00 /var/rudder/cfengine-community/bin/cf-serverd
 2077 ?        Ss     0:00 /var/rudder/cfengine-community/bin/cf-execd

As we can see, rudder-agent is not stated after the installation of the package. I suggest to reject this bug, do you agree ?

Actions #2

Updated by Dennis Cabooter over 9 years ago

On our RHEL 5.9 nodes this happens:

[root@server ~]# echo 'rudder' > /var/rudder/cfengine-community/policy_server.dat
[root@server ~]# service rudder-agent start
rudder-agent[2894]: [INFO] Using /etc/default/rudder-agent for configuration
rudder-agent[2898]: [INFO] Using /var/rudder/cfengine-community for CFEngine workdir
rudder-agent[2899]: [INFO] Launching CFEngine Community cf-serverd...
Could not bind server address
 !!! System reports error for bind: "Address already in use" 
Could not bind server address
 !!! System reports error for bind: "Address already in use" 
Couldn't open bind an open socket
rudder-agent[2907]: [OK] CFEngine Community cf-serverd started after 1 seconds
rudder-agent[2908]: [INFO] Launching CFEngine Community cf-execd...
rudder-agent[2940]: [OK] CFEngine Community cf-execd started after 1 seconds
Actions #3

Updated by Dennis Cabooter over 9 years ago

And before that I see this message:

rudder-agent[2266]: [INFO] Launching CFEngine Community cf-serverd...
rudder-agent[2286]: [OK] CFEngine Community cf-serverd started after 1 seconds
rudder-agent[2287]: [INFO] Launching CFEngine Community cf-execd...
rudder-agent[2297]: [OK] CFEngine Community cf-execd started after 1 seconds
Actions #4

Updated by Jonathan CLARKE over 9 years ago

That is indeed weird, because the post-install script is quite clear that it will either print that message, or start rudder-agent, but not both.

If you did this on a machine that already has rudder-agent installed previously, this may explain this situation. Was that the case?

Actions #5

Updated by Michael Gliwinski over 9 years ago

Jonathan CLARKE wrote:

That is indeed weird, because the post-install script is quite clear that it will either print that message, or start rudder-agent, but not both.

If you did this on a machine that already has rudder-agent installed previously, this may explain this situation. Was that the case?

I just ran into this and I was indeed installing on a bunch of hosts that did have (an older version) of rudder-agent on in the past. I've noticed that cf-agent process was started from cron, I'm assuming this then started cf-serverd and cf-execd.

I can confirm that uninstalling rudder-agent does not remove /etc/cron.d/rudder-agent (nor the entry from /etc/crontab in older versions).

BTW, it also doesn't remove /etc/rsyslog.d/rudder-agent.conf and I found I need to restart rsyslog after installing and starting new version as otherwise reports weren't going to the new server.

Actions #6

Updated by Matthieu CERDA over 9 years ago

  • Project changed from Rudder to 34
  • Subject changed from Wrong install message on RHEL nodes to The Rudder agent post installation and removal scripts are not cleaning things correctly
  • Status changed from Discussion to In progress
  • Assignee changed from Dennis Cabooter to Matthieu CERDA
  • Priority changed from N/A to 2
  • Target version set to 2.4.8

So this is a packaging issue, I'm correcting this, and making sure that the agent does not start when it should not.

Actions #7

Updated by Matthieu CERDA over 9 years ago

  • Status changed from In progress to Pending technical review
  • % Done changed from 0 to 100
  • Pull Request set to https://github.com/Normation/rudder-packages/pull/105
Actions #8

Updated by Matthieu CERDA over 9 years ago

  • Status changed from Pending technical review to Pending release

Applied in changeset commit:4b52376ebafb49cfec55eb6819cb3af1b1df3b8b.

Actions #9

Updated by Jonathan CLARKE over 9 years ago

Applied in changeset commit:5f02a6fb47525bbcde7a46d0b940c1adc9032484.

Actions #10

Updated by Nicolas PERRON over 9 years ago

  • Status changed from Pending release to Discussion
  • Assignee changed from Matthieu CERDA to Jonathan CLARKE

Do we really want to rm -rdf /opt/rudder and /var/rudder after an uninstall ?

Actions #11

Updated by Jonathan CLARKE over 9 years ago

  • Assignee changed from Jonathan CLARKE to Matthieu CERDA

Nicolas PERRON wrote:

Do we really want to rm -rdf /opt/rudder and /var/rudder after an uninstall ?

Hmmm. That is common practice for directories created by the packages, yes... But, now I come to think of it, if you remove rudder-agent on a Rudder server, that will remove all other files there (rudder-webapp, techniques, etc...)!

I guess we shouldn't do this. Let's try and be more precise with our rm -rf *...

Actions #12

Updated by Nicolas PERRON over 9 years ago

  • Status changed from Discussion to Pending technical review

Jonathan CLARKE wrote:

Nicolas PERRON wrote:

Do we really want to rm -rdf /opt/rudder and /var/rudder after an uninstall ?

Hmmm. That is common practice for directories created by the packages, yes... But, now I come to think of it, if you remove rudder-agent on a Rudder server, that will remove all other files there (rudder-webapp, techniques, etc...)!

I guess we shouldn't do this. Let's try and be more precise with our rm -rf *...

This ticket can be set to "Pending release" again since #3896 solve the problem

Actions #13

Updated by Nicolas PERRON over 9 years ago

  • Status changed from Pending technical review to Pending release
Actions #14

Updated by Nicolas PERRON over 9 years ago

  • Status changed from Pending release to Released

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

Actions #15

Updated by Benoît PECCATTE almost 8 years ago

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

Also available in: Atom PDF