Description of problem: According to https://fedoraproject.org/wiki/Packaging/SysVInitScript uuidd component init scripts have some lsb compliance issues: 1. Init script should return code "4" if restarting service under nonprivileged user: # su testuserqa -c "service uuidd restart"; echo $? Stopping uuidd: [FAILED] rm: cannot remove `/var/lock/subsys/uuidd': Permission denied Starting uuidd: touch: cannot touch `/var/lock/subsys/uuidd': Permission denied 0 now: 0 expected: 4 2. try-restart action should be supported 3. nonexist action should have return code "2": # service uuidd nonexist ; echo $? Usage: /etc/init.d/uuidd {start|stop|status|restart|reload|force-reload|condrestart} 1 now: 1 expected: 2 4. Initscript should return code "1", when program is dead and /var/run pid file exists: # service uuidd start Starting uuidd: [ OK ] # ps ax | grep uuidd 23905 ? Ss 0:00 /usr/sbin/uuidd # kill -11 23905 # ls -l /var/run/uuidd/*.pid -rw-r--r--. 1 uuidd uuidd 9 2009-11-25 20:03 /var/run/uuidd/uuidd.pid # service uuidd status ; echo $? uuidd dead but subsys locked ->> it should be "uuidd dead but pid file exists" 2 now: 2 expected: 1 5. Initscript should return code "0" on status action for started service: # service uuidd start Starting uuidd: [ OK ] # service uuidd status ; echo $? uuidd dead but subsys locked 2 now: 2 expected: 0
Karel, I have tried util-linux-ng-2.17-3.fc13.x86_64 # service uuidd start ; echo $? 4 # touch /var/lock/subsys/uuidd # service uuidd start ; echo $? Starting uuidd: [ OK ] 0 Service does not start cause of this start() { ... [ -w $LOCKFILE ] || exit 4 $LOCKFILE is removed with stop()
Initscript should return code "1", when program is dead and /var/run pid file exists: # service uuidd start ; echo $? 0 # ls -l /var/run/uuidd/uuidd.pid -rw-r--r--. 1 uuidd uuidd 9 Feb 16 12:57 /var/run/uuidd/uuidd.pid # ps ax | grep uuidd 29852 ? Ss 0:00 /usr/sbin/uuidd 29901 pts/2 S+ 0:00 grep uuidd # kill -11 29852 # ls -l /var/run/uuidd/uuidd.pid -rw-r--r--. 1 uuidd uuidd 9 Feb 16 12:57 /var/run/uuidd/uuidd.pid # service uuidd status ; echo $? <--- If pid file exists it should return 1 not 2 uuidd dead but subsys locked 2 # touch /var/run/uuidd.pid # service uuidd status ; echo $? uuidd dead but pid file exists 1 Looks like it tries to check if /var/run/uuidd.pid exists not /var/run/uuidd/uuidd.pid
(In reply to comment #2) > Service does not start cause of this > start() { > ... > [ -w $LOCKFILE ] || exit 4 > > $LOCKFILE is removed with stop() Fixed. Sorry, stupid bug. (In reply to comment #3) > Initscript should return code "1", when program is dead and /var/run pid > file exists: [...] > # service uuidd status ; echo $? <--- If pid file exists it should return 1 not > 2 > uuidd dead but subsys locked > 2 > > # touch /var/run/uuidd.pid > # service uuidd status ; echo $? > uuidd dead but pid file exists > 1 > > Looks like it tries to check if /var/run/uuidd.pid exists > not /var/run/uuidd/uuidd.pid Yes, it's necessary to call 'status' function from /etc/init.d/functions with option "-p $pidfile" if the pid file is not directly in the /var/run directory. Fixed. It would be nice to add a check() function (for example from cupsd initscript) and the hint about "status -p $pidfile" to the template at https://fedoraproject.org/wiki/Packaging/SysVInitScript
Verified bugs are fixed with util-linux-ng-2.17-4.fc13.x86_64 Thank you, Karel