Bug 431039 - radvd does not start if stale lockfile present
radvd does not start if stale lockfile present
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: radvd (Show other bugs)
8
i386 Linux
low Severity medium
: ---
: ---
Assigned To: Martin Nagy
Fedora Extras Quality Assurance
: Patch, Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-31 06:55 EST by Pim Zandbergen
Modified: 2016-07-26 19:46 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-04-11 04:52:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
kevin: fedora‑cvs+


Attachments (Terms of Use)
Patch to fix the issue (1.31 KB, patch)
2008-04-04 09:18 EDT, Martin Nagy
no flags Details | Diff

  None (edit)
Description Pim Zandbergen 2008-01-31 06:55:37 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.10) Gecko/20071213 Fedora/2.0.0.10-3.fc8 Firefox/2.0.0.10

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):
radvd-1.0-5.fc8

How reproducible:
Always


Steps to Reproduce:
1. service radvd start
2. killall -9 radvd
3. service radvd status
4. service radvd start


Actual Results:
3. radvd is stopped
4. Starting radvd: another radvd seems to be already running, terminating [FAILED]



Expected Results:
3. radvd is stopped
4. Starting radvd: [ OK ]

Additional info:
radvd will start again after removing /var/run/radvd/radvd.pid
Comment 1 Martin Nagy 2008-02-25 05:56:01 EST
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.
Comment 2 Pim Zandbergen 2008-02-26 09:18:53 EST
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
ungracefully.

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. 
Comment 3 Martin Nagy 2008-04-04 09:18:54 EDT
Created attachment 300427 [details]
Patch to fix the issue

With this patch, radvd will remove stale pid file.
Comment 4 Martin Nagy 2008-04-10 09:58:49 EDT
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.
Comment 5 Kevin Fenzi 2008-04-10 13:29:22 EDT
cvs done.
Comment 6 Martin Nagy 2008-04-11 04:52:55 EDT
Fixed in radvd-1.1-3.fc10

Note You need to log in before you can comment on or make changes to this bug.