Bug 431039 - radvd does not start if stale lockfile present
Summary: radvd does not start if stale lockfile present
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: radvd
Version: 8
Hardware: i386
OS: Linux
low
medium
Target Milestone: ---
Assignee: Martin Nagy
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-01-31 11:55 UTC by Pim Zandbergen
Modified: 2016-07-26 23:46 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-04-11 08:52:55 UTC
Type: ---
Embargoed:
kevin: fedora-cvs+


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

Description Pim Zandbergen 2008-01-31 11:55:37 UTC
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 10:56:01 UTC
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 14:18:53 UTC
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 13:18:54 UTC
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 13:58:49 UTC
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 17:29:22 UTC
cvs done.

Comment 6 Martin Nagy 2008-04-11 08:52:55 UTC
Fixed in radvd-1.1-3.fc10


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