Project

General

Profile

Actions

Bug #3457

closed

"/etc/init.d/rudder-agent stop" or "/etc/init.d/rudder-agent forcestop" don't stop and diplay error messages about bad usage of kill

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

Status:
Released
Priority:
N/A
Assignee:
Nicolas PERRON
Category:
Packaging
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

Description

It seems that is not possible to stop CFEngine with the commands of /etc/init.drudder-agent on Rudder 2.5

sles-10-sp3-64:~/eclient_test/sdfscsrv20 # /etc/init.d/rudder-agent stop
rudder-agent[30681]: [INFO] Using /etc/default/rudder-agent for configuration
rudder-agent[30684]: [INFO] Using /var/rudder/cfengine-community for CFEngine workdir
rudder-agent[30685]: [INFO] Halting CFEngine Community cf-serverd...
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]

rudder-agent[30807]: [ALERT] cf-serverd still running (PID ), try: /etc/init.d/rudder-agent forcestop
sles-10-sp3-64:~/eclient_test/sdfscsrv20 # /etc/init.d/rudder-agent forcestop
rudder-agent[31036]: [INFO] Using /etc/default/rudder-agent for configuration
rudder-agent[31039]: [INFO] Using /var/rudder/cfengine-community for CFEngine workdir
rudder-agent[31045]: [INFO] Killing CFEngine Community cf-serverd with force...
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
rudder-agent[31047]: [ALERT] Unable to kill CFEngine Community cf-serverd with force (PID )
rudder-agent[31053]: [INFO] Killing CFEngine Community cf-execd with force...
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
rudder-agent[31055]: [ALERT] Unable to kill CFEngine Community cf-execd with force (PID )
Actions #1

Updated by Nicolas PERRON over 11 years ago

  • Target version changed from 2.5.2 to 2.5.3
Actions #2

Updated by Nicolas PERRON over 11 years ago

  • Status changed from New to In progress
  • Assignee set to Nicolas PERRON

The only way to reproduce this bug is to have the files /var/rudder/cfengine-community/{cf-execd.pid,cf-serverd.pid} empty.

During the stop process, the files are removed:

root@rudder-snapshot:~# ls -lh /var/rudder/cfengine-community/cf-*
-rw-r--r-- 1 root root 6 Apr 24 12:08 /var/rudder/cfengine-community/cf-execd.pid
-rw------- 1 root root 6 Apr 24 12:08 /var/rudder/cfengine-community/cf-serverd.pid

root@rudder-snapshot:~# /etc/init.d/rudder-agent stop
rudder-agent[28372]: [INFO] Using /etc/default/rudder-agent for configuration
rudder-agent[28375]: [INFO] Using /var/rudder/cfengine-community for CFEngine workdir
rudder-agent[28376]: [INFO] Halting CFEngine Community cf-serverd...
rudder-agent[28380]: [OK] CFEngine Community cf-serverd stopped after 2 seconds
rudder-agent[28381]: [INFO] Halting CFEngine Community cf-execd...
rudder-agent[28385]: [OK] CFEngine Community cf-execd stopped after 2 seconds

root@rudder-snapshot:~# root@rudder-snapshot:~# ls -lh /var/rudder/cfengine-community/cf-*
-bash: root@rudder-snapshot:~#: command not found

...but it is still possible to stop:

root@rudder-snapshot:~# /etc/init.d/rudder-agent stop
rudder-agent[28395]: [INFO] Using /etc/default/rudder-agent for configuration
rudder-agent[28398]: [INFO] Using /var/rudder/cfengine-community for CFEngine workdir
rudder-agent[28399]: [INFO] Halting CFEngine Community cf-serverd...
rudder-agent[28400]: [INFO] can't read PID file, not stopping cf-serverd
rudder-agent[28401]: [INFO] Halting CFEngine Community cf-execd...
rudder-agent[28402]: [INFO] can't read PID file, not stopping cf-execd
rudder-agent[28408]: [INFO] Found no CFEngine Community cf-serverd processes running
rudder-agent[28415]: [INFO] Found no CFEngine Community cf-execd processes running

If I have an empty file, the stop process will hang for a certain amount of time:

root@rudder-snapshot:~# touch /var/rudder/cfengine-community/cf-execd.pid

root@rudder-snapshot:~# /etc/init.d/rudder-agent stop
rudder-agent[28437]: [INFO] Using /etc/default/rudder-agent for configuration
rudder-agent[28441]: [INFO] Using /var/rudder/cfengine-community for CFEngine workdir
rudder-agent[28442]: [INFO] Halting CFEngine Community cf-serverd...
rudder-agent[28443]: [INFO] can't read PID file, not stopping cf-serverd
rudder-agent[28444]: [INFO] Halting CFEngine Community cf-execd...
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]

If the file contain not an integer, it will just warn about an error and will delete the file (all will be OK again):

root@rudder-snapshot:~# echo "21.1" > /var/rudder/cfengine-community/cf-execd.pid

root@rudder-snapshot:~# /etc/init.d/rudder-agent stop
rudder-agent[28548]: [INFO] Using /etc/default/rudder-agent for configuration
rudder-agent[28551]: [INFO] Using /var/rudder/cfengine-community for CFEngine workdir
rudder-agent[28552]: [INFO] Halting CFEngine Community cf-serverd...
rudder-agent[28553]: [INFO] can't read PID file, not stopping cf-serverd
rudder-agent[28554]: [INFO] Halting CFEngine Community cf-execd...
/etc/init.d/rudder-agent: line 229: kill: 21.1: arguments must be process or job IDs
rudder-agent[28556]: [OK] CFEngine Community cf-execd stopped after 1 seconds
rudder-agent[28562]: [INFO] Found no CFEngine Community cf-serverd processes running
rudder-agent[28569]: [INFO] Found no CFEngine Community cf-execd processes running

root@rudder-snapshot:~# ls -lh /var/rudder/cfengine-community/cf-execd.pid
ls: cannot access /var/rudder/cfengine-community/cf-execd.pid: No such file or directory

During start, whatever the file exists or not, all will be ok:

root@rudder-snapshot:~# touch  /var/rudder/cfengine-community/cf-execd.pid

root@rudder-snapshot:~# /etc/init.d/rudder-agent start
rudder-agent[28816]: [INFO] Using /etc/default/rudder-agent for configuration
rudder-agent[28820]: [INFO] Using /var/rudder/cfengine-community for CFEngine workdir
rudder-agent[28821]: [INFO] Launching CFEngine Community cf-serverd...
rudder-agent[28845]: [OK] CFEngine Community cf-serverd started after 1 seconds
rudder-agent[28846]: [INFO] Launching CFEngine Community cf-execd...
rudder-agent[28870]: [OK] CFEngine Community cf-execd started after 1 seconds

root@rudder-snapshot:~# cat  /var/rudder/cfengine-community/cf-execd.pid
28867

Actions #3

Updated by Nicolas PERRON over 11 years ago

  • Target version changed from 2.5.3 to 2.3.12
Actions #4

Updated by Nicolas PERRON over 11 years ago

  • Project changed from Rudder to 34
Actions #5

Updated by Nicolas PERRON over 11 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/44

Pull Request URL added: https://github.com/Normation/rudder-packages/pull/44

Jon, could you review it please ?

Actions #6

Updated by Nicolas PERRON over 11 years ago

  • Status changed from Pending technical review to Pending release

Applied in changeset commit:aab3dcf2c3e3b93e5617949d03930ad90083eeac.

Actions #7

Updated by Jonathan CLARKE over 11 years ago

Applied in changeset commit:9f14932db6541151ef41c4a93b83f1a637912445.

Actions #8

Updated by Nicolas PERRON over 11 years ago

  • Status changed from Pending release to Released
Actions #9

Updated by Benoît PECCATTE almost 10 years ago

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

Also available in: Atom PDF