]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC r208190, r229667, r230541, r230869, r231909, r231910, r231911, r231912:
authortrociny <trociny@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 1 Apr 2012 20:56:07 +0000 (20:56 +0000)
committertrociny <trociny@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 1 Apr 2012 20:56:07 +0000 (20:56 +0000)
commit292e2bd6214df8941288a25578f89ebb906a34bf
treec2014abb4c977a94355eb88ba8421dde3d502ef0
parent366046c8f3ed24d344361deb60fdcb9b23635578
MFC r208190, r229667, r230541, r230869, r231909, r231910, r231911, r231912:

r208190 (ivoras):

Slightly improve wording.

r229667, r230541, r230869 (ghelmer):

Change the notes about the pidfile to include Doug's preference
for pre-creating the pidfile with appropriate owner and permissions.

Requested by dougb

r231909:

The pidfile_open(3) is going to be fixed to set close-on-exec in order
not to leak the descriptor after exec(3). This raises the issue for
daemon(3) of the pidfile lock to be lost when the child process
executes.

To solve this and also to have the pidfile cleaned up when the program
exits, if a pidfile is specified, spawn a child to exec the command
and wait in the parent keeping the pidfile locked until the child
process exits and remove the file.

Reported by: Andrey Zonov <andrey zonov org>
Suggested by: pjd
Reviewed by: pjd

r231910:

If the supervising process receives SIGTERM, forward it to the spawned
process.  Normally it will cause the child to exit followed by the
termination of the supervisor after removing the pidfile.

This looks like desirable behavior, because termination of a
supervisor usually supposes termination of its charge. Also it will
fix the issue with stale pid files after reboot due to init kills a
supervisor before its child exits.

r231911:

Add -r option to restart the program if it has been terminated.

Suggested by: Andrey Zonov <andrey zonov org>

r231912:

If permitted protect the supervisor against pageout kill.

Suggested by: Andrey Zonov <andrey zonov org>

git-svn-id: svn://svn.freebsd.org/base/stable/8@233762 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
usr.sbin/daemon/daemon.8
usr.sbin/daemon/daemon.c