<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/usr.sbin/daemon/daemon.c, branch stable/8</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>MFC r255521, r255526, r255707:</title>
<updated>2013-10-03T18:50:09+00:00</updated>
<author>
<name>Mikolaj Golub</name>
<email>trociny@FreeBSD.org</email>
</author>
<published>2013-10-03T18:50:09+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=7fe26b67eda878661402fd22161122f3f6e4aef6'/>
<id>7fe26b67eda878661402fd22161122f3f6e4aef6</id>
<content type='text'>
r255521 (jmg):

add support for writing the pid of the daemon program to a pid file so
that daemon can be used w/ rc.subr and ports can use the additional
functionality, such as keeping the ldap daemon up and running, and have
the proper program to signal to exit.

PR:		bin/181341
Submitted by:	feld

r255526 (joel):

mdoc: remove EOL whitespace.

r255707:

1. Properly clean pid files in the case of the error.
2. Write the supervisor pid before the restart loop, so we don't
   uselessly rewrite it after every child restart.
3. Remove duplicate ppfh and pfh initialization.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
r255521 (jmg):

add support for writing the pid of the daemon program to a pid file so
that daemon can be used w/ rc.subr and ports can use the additional
functionality, such as keeping the ldap daemon up and running, and have
the proper program to signal to exit.

PR:		bin/181341
Submitted by:	feld

r255526 (joel):

mdoc: remove EOL whitespace.

r255707:

1. Properly clean pid files in the case of the error.
2. Write the supervisor pid before the restart loop, so we don't
   uselessly rewrite it after every child restart.
3. Remove duplicate ppfh and pfh initialization.
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC: r244986</title>
<updated>2013-01-27T17:41:29+00:00</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2013-01-27T17:41:29+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=c6d0b003743e2679dce861f2f14cba1c1273389f'/>
<id>c6d0b003743e2679dce861f2f14cba1c1273389f</id>
<content type='text'>
Remove bogus '-' from getopt(3) string hit when porting daemon(8) to
GNU/Linux *duck*.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove bogus '-' from getopt(3) string hit when porting daemon(8) to
GNU/Linux *duck*.
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r236550, r236551:</title>
<updated>2012-06-12T20:05:22+00:00</updated>
<author>
<name>Mikolaj Golub</name>
<email>trociny@FreeBSD.org</email>
</author>
<published>2012-06-12T20:05:22+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=612aa854726cea2d3e40cf129e83902c09051171'/>
<id>612aa854726cea2d3e40cf129e83902c09051171</id>
<content type='text'>
r236550:

On a child exit, call waitpid(2) to clean up the process table.

Submitted by:	Andrey Zonov &lt;andrey zonov.org&gt;

r236551:

Document -r option in SYNOPSIS and usage statement.

Submitted by:	Andrey Zonov &lt;andrey zonov.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
r236550:

On a child exit, call waitpid(2) to clean up the process table.

Submitted by:	Andrey Zonov &lt;andrey zonov.org&gt;

r236551:

Document -r option in SYNOPSIS and usage statement.

Submitted by:	Andrey Zonov &lt;andrey zonov.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r208190, r229667, r230541, r230869, r231909, r231910, r231911, r231912:</title>
<updated>2012-04-01T20:56:07+00:00</updated>
<author>
<name>Mikolaj Golub</name>
<email>trociny@FreeBSD.org</email>
</author>
<published>2012-04-01T20:56:07+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=5487b28d6c79b20239087cf55ba22fce3670a913'/>
<id>5487b28d6c79b20239087cf55ba22fce3670a913</id>
<content type='text'>
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 &lt;andrey zonov org&gt;
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 &lt;andrey zonov org&gt;

r231912:

If permitted protect the supervisor against pageout kill.

Suggested by:	Andrey Zonov &lt;andrey zonov org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;andrey zonov org&gt;
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 &lt;andrey zonov org&gt;

r231912:

If permitted protect the supervisor against pageout kill.

Suggested by:	Andrey Zonov &lt;andrey zonov org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Unbreak rev 1.7's getopt usage.  The -f switch does not take an argument.</title>
<updated>2007-04-19T16:43:30+00:00</updated>
<author>
<name>Peter Wemm</name>
<email>peter@FreeBSD.org</email>
</author>
<published>2007-04-19T16:43:30+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=12d5df2b3cfb6aa602a3ccdb252de202863e1956'/>
<id>12d5df2b3cfb6aa602a3ccdb252de202863e1956</id>
<content type='text'>
The stray ':' was from the defunct '-g' group arg.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The stray ':' was from the defunct '-g' group arg.
</pre>
</div>
</content>
</entry>
<entry>
<title>Improve previous commit by using setusercontext(3) and removing the group</title>
<updated>2007-03-19T12:12:53+00:00</updated>
<author>
<name>Tom Rhodes</name>
<email>trhodes@FreeBSD.org</email>
</author>
<published>2007-03-19T12:12:53+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=e6d4b388b9b5268be5e9cfe7c080c94084947315'/>
<id>e6d4b388b9b5268be5e9cfe7c080c94084947315</id>
<content type='text'>
option.  Bump doc date for manual page changes.

Reviewed by:	rwatson, ru, will (older version)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
option.  Bump doc date for manual page changes.

Reviewed by:	rwatson, ru, will (older version)
</pre>
</div>
</content>
</entry>
<entry>
<title>Initialize *pfh to NULL to quiet a gcc warning, not part of my original</title>
<updated>2007-03-09T09:40:23+00:00</updated>
<author>
<name>Tom Rhodes</name>
<email>trhodes@FreeBSD.org</email>
</author>
<published>2007-03-09T09:40:23+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=15543aadb309a05769091a5aeb17054bb25f2ecf'/>
<id>15543aadb309a05769091a5aeb17054bb25f2ecf</id>
<content type='text'>
commit because it was not part of the new code.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit because it was not part of the new code.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add support for dropping privileges to a specified user and/or group.</title>
<updated>2007-03-09T09:33:19+00:00</updated>
<author>
<name>Tom Rhodes</name>
<email>trhodes@FreeBSD.org</email>
</author>
<published>2007-03-09T09:33:19+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=12d7249e24f4660e13798b32fae7ce55d4b23cc9'/>
<id>12d7249e24f4660e13798b32fae7ce55d4b23cc9</id>
<content type='text'>
PR:		108523
Submitted by:	Dmitri Alenitchev &lt;dmitri@dworlds.ru&gt; (original version)
Reviewed by:	mpp (first reply to PR)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PR:		108523
Submitted by:	Dmitri Alenitchev &lt;dmitri@dworlds.ru&gt; (original version)
Reviewed by:	mpp (first reply to PR)
</pre>
</div>
</content>
</entry>
<entry>
<title>Teach daemon(8) how to use pidfile(3).</title>
<updated>2005-08-24T17:24:39+00:00</updated>
<author>
<name>Pawel Jakub Dawidek</name>
<email>pjd@FreeBSD.org</email>
</author>
<published>2005-08-24T17:24:39+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=c6262cb601a0159637789563708f64368c30537c'/>
<id>c6262cb601a0159637789563708f64368c30537c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Give daemon(8) the ability to create a pid-file.  Since the target program</title>
<updated>2004-06-02T06:48:13+00:00</updated>
<author>
<name>Poul-Henning Kamp</name>
<email>phk@FreeBSD.org</email>
</author>
<published>2004-06-02T06:48:13+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=846be7bd0ebecc5cb13cdbf270a820d31b5a2708'/>
<id>846be7bd0ebecc5cb13cdbf270a820d31b5a2708</id>
<content type='text'>
does not know anything about the pid-file and we don't keep a babysitting
process for the task, the pid-file will linger.

Submitted by:	mi
PR:	56398
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
does not know anything about the pid-file and we don't keep a babysitting
process for the task, the pid-file will linger.

Submitted by:	mi
PR:	56398
</pre>
</div>
</content>
</entry>
</feed>
