Red Hat Bugzilla – Bug 431039
radvd does not start if stale lockfile present
Last modified: 2016-07-26 19:46:47 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:220.127.116.11) Gecko/20071213 Fedora/18.104.22.168-3.fc8 Firefox/22.214.171.124
Description of problem:
If radvd did not quit gracefully, it will not restart unless the lockfile has been removed manually.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. service radvd start
2. killall -9 radvd
3. service radvd status
4. service radvd start
3. radvd is stopped
4. Starting radvd: another radvd seems to be already running, terminating [FAILED]
3. radvd is stopped
4. Starting radvd: [ OK ]
radvd will start again after removing /var/run/radvd/radvd.pid
I don't think this is a bug. Otherwise, what's the point of the whole pid file?
If you mess with it using kill and not properly stopping it using init script,
you should as well remove the pid file yourself. Otherwise, if something bad
happens and radvd will quit without removing the pid file, I think it is right
not to ignore this, so the user knows something went wrong.
Thus, closing as NOTABUG. If you still think this is a bug, feel free to reopen.
My steps to reproduce should be seen as a simulation of what could happen in
real life. I don't kill radvd; radvd could just die (it sometimes does, I will
report this once I have more data) or the system could crash, panic, or there
might be a power interruption.
In all these cases, radvd will not start after a reboot. This might leave a
whole network disconnected. These consequences vastly outweigh the importance
that a user should be made aware that a simple, stateless service has exited
The point of having a pid file is to create a means to disallow multiple
instances of a service, and to have a way to send signals to the service. There
are multiple ways to have a service check the validity of a pid file. One way is
to open it, check the pid against getpid(), and send a signal to see the process
represented by the pid is alive. Another way is to use flock() against the pid
file. This will fail if there is another instance which also locks the file.
Almost every service using pid files uses these techniques to discover stale pid
files, so they can be reused or removed.
radvd, only checks the existence of the pid file and thereby is lacking basic
robustness which should be qualified as a bug.
If you, after reading this plea, still do not consider this a bug, then so be it.
Created attachment 300427 [details]
Patch to fix the issue
With this patch, radvd will remove stale pid file.
Package Change Request
Package Name: radvd
New Branches: F-9
Would like to have another branch so I can apply patch for this bug. Thanks.
Fixed in radvd-1.1-3.fc10