Bug 190643 - daemon(8): /usr/sbin/daemon -P option does not work as documented
Summary: daemon(8): /usr/sbin/daemon -P option does not work as documented
Status: Closed DUPLICATE of bug 187265
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 9.2-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-05 03:47 UTC by barney
Modified: 2014-06-13 14:29 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description barney 2014-06-05 03:47:50 UTC
If daemon's -P option is used without the -p option, the pidfile is not removed when the process terminates.  To demonstrate:
/usr/sbin/daemon -P pid.daemon sleep 5
After sleep terminates, pid.daemon is left around, pointing to a nonexistent process.  It also seems that there is no separate daemon process, as the pid.daemon file points to the sleep process.

The danger of leaving the pidfile around is of course when pids cycle around an unintended process might be terminated.

This might be treated as a documentation bug, as using -P without -p or -r is at least unusual.
Comment 1 Ed Maste freebsd_committer freebsd_triage 2014-06-13 14:27:57 UTC
This is http://bugs.freebsd.org/187265, fixed in HEAD and stable/10, but not stable/9.

I will merge the fix in time for 9.3 if possible.
Comment 2 Ed Maste freebsd_committer freebsd_triage 2014-06-13 14:29:59 UTC

*** This bug has been marked as a duplicate of bug 187265 ***