History log of /freebsd-head/usr.sbin/daemon/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
68f1c44ed4984e9ed24896bb3f5d1cd8f3bfbe6d 02-Oct-2019 ian <ian@FreeBSD.org> Bump .Dd for earlier update (should have been part of r353024).
aemon.8
2795f67defad86f06151821f936fcce16d8161c3 02-Oct-2019 ian <ian@FreeBSD.org> Clarify how the -f option for daemon(8) interacts with other options
related to redirecting stdout and stderr.
aemon.8
175ae3661abf2f4b0521067aaa5f2bbc1f9c8845 04-Jun-2019 cem <cem@FreeBSD.org> daemon(8): Don't block SIGTERM during restart delay

I believe this was introduced in the original '-r' commit, r231911 (2012).
At the time, the scope was limited to a 1 second sleep. r332518 (2018)
added '-R', which increased the potential duration of the affected interval
(from 1 to N seconds) by permitting arbitrary restart intervals.

Instead, handle SIGTERM normally during restart-sleep, when the monitored
process is not running, and shut down promptly.

(I noticed this behavior when debugging a child process that exited quickly
under the 'daemon -r -R 30' environment. 'kill <daemonpid>' had no
immediate effect and the monitor process slept until the next restart
attempt. This was annoying.)

Reviewed by: allanjude, imp, markj
Differential Revision: https://reviews.freebsd.org/D20509
aemon.c
301382caa9540a4671838e7d977014e0cdeb78f7 25-Mar-2019 grembo <grembo@FreeBSD.org> Correct contradictory information on default syslog logging priority.

MFC after: 1 week
aemon.8
b8dfd027887fbbf30986421f2b49adc5edf5861b 09-Nov-2018 0mp <0mp@FreeBSD.org> Cross-reference nohup(1) and daemon(8).

Reviewed by: bcr
Approved by: krion (mentor, implicit), mat (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D17920
aemon.8
51788dda1c2247106cef91e99044681bd40f7455 01-Aug-2018 0mp <0mp@FreeBSD.org> Add a missing "Ar" macro to the description of the -R flag in the manpage.

Approved by: bjk (doc committer), krion (mentor)
Differential Revision: https://reviews.freebsd.org/D16520
aemon.8
a122968349d690da6c416ce3635d9e26eaa02c8e 16-Apr-2018 ian <ian@FreeBSD.org> Fix cut-and-pasted line to have the right option letter.

Reported by: 0mp@
Pointy hat: ian@
aemon.8
82716f32f7e8af7ddfaab15e6b6e4bb25f4de9fd 15-Apr-2018 ian <ian@FreeBSD.org> Add an option to daemon(8) to specify a delay between restarts of a
supervised program. The existing -r option has a hard-coded delay of one
second. This change adds a -R option which takes a delay in seconds. This
can be used to prevent log spam and rapid restarts, similar to init(8)'s
behavior of adding a delay between rapid restarts when it's supervising a
program.
aemon.8
aemon.c
05174f530061933590fd22d3a0a4d2afa3bc044f 26-Jan-2018 maxim <maxim@FreeBSD.org> o A command line flag for the syslog_facility fixed in the SYNOPSIS.

PR: 225441
aemon.8
7551d83c353e040b32c6ac205e577dbc5f2c8955 27-Nov-2017 pfg <pfg@FreeBSD.org> various: general adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
aemon.c
a598c4b809a73772d7452991213407cdac302156 31-Oct-2017 bdrewery <bdrewery@FreeBSD.org> DIRDEPS_BUILD: Update dependencies.

Sponsored by: Dell EMC Isilon
akefile.depend
fa5e66f74b20d0c62fd74db63dbe6da8431ce6d5 13-Nov-2016 bdrewery <bdrewery@FreeBSD.org> DIRDEPS_BUILD: Update dependencies.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
akefile.depend
0808a69a8d1d5bcd2444376f5b0cbb396f7ebf9a 22-Oct-2016 jilles <jilles@FreeBSD.org> daemon: Allow logging daemon stdout/stderr to file or syslog.

There are various new options, documented in the man page, to send the
daemon's standard output and/or standard error to a file or to syslog.

Submitted by: ank at iki.fi
Reviewed by: wblock (man page only)
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D7993
aemon.8
aemon.c
b5622b71b112405a0eabdf0d57f0e498e1c71be8 03-Mar-2016 maxim <maxim@FreeBSD.org> o -t comman line option added to the usage().
aemon.c
5f5b2719b9571954923d0973cae4e260da9bc3c3 02-Mar-2016 cem <cem@FreeBSD.org> daemon(8): Add -t option to set process title

The default process title is taken from the argv[0] value (any
particular hardlink name). Add a -t option to override the default.

PR: 205016
Submitted by: Yuri <yuri@rawbw.com>
No objection from: freebsd-current@
Sponsored by: EMC / Isilon Storage Division
aemon.8
aemon.c
008d7c831feeec7a3430b92f009e28762c6740f1 13-Jun-2015 sjg <sjg@FreeBSD.org> Add META_MODE support.

Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision: D2796
Reviewed by: brooks imp
75a137820de70f75cd932fd2fa365fabaf06fa90 08-Jun-2015 sjg <sjg@FreeBSD.org> dirdeps.mk now sets DEP_RELDIR
akefile.depend
65145fa4c81da358fcbc3b650156dab705dfa34e 27-May-2015 sjg <sjg@FreeBSD.org> Merge sync of head
a191ba5195ecb988c5e5c3b13fc364bde87bd41c 25-Nov-2014 bapt <bapt@FreeBSD.org> Convert usr.sbin to LIBADD
Reduce overlinking
akefile
5860f0d10657dc9748acf6637885ee7fbf6fb212 16-May-2014 sjg <sjg@FreeBSD.org> Updated dependencies
akefile.depend
1a7e48acf1acf8cb3ef3ba6787cc57e18faa8479 10-May-2014 sjg <sjg@FreeBSD.org> Updated dependencies
akefile.depend
5e568154a01fb6be74908baed265f265a56f002f 28-Apr-2014 sjg <sjg@FreeBSD.org> Merge head
d8d70b37e358a21eb43279c7b10f54f75053ed92 06-Apr-2014 jh <jh@FreeBSD.org> Fork a child process and wait until the process terminates when the -P
option is specified. This behavior is documented on the manual page.

PR: bin/187265
Submitted by: Kimo R
MFC after: 2 weeks
aemon.c
7fcd33c1faf567506b5c0b4148c7a15a10788a5d 13-Oct-2013 sjg <sjg@FreeBSD.org> Merge head@256284
8ecfe4666e7be9cea4cf6c3ef929de2e8d286f41 19-Sep-2013 trociny <trociny@FreeBSD.org> 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.

Approved by: re (glebius)
MFC after: 2 weeks
aemon.c
99904243da23aa13861ff7c8f308dd5d325cc765 13-Sep-2013 joel <joel@FreeBSD.org> mdoc: remove EOL whitespace.

Approved by: re (blanket)
aemon.8
1b9dc8f60c0b501e17ab3dcdceb4fb2797485692 13-Sep-2013 jmg <jmg@FreeBSD.org> 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
Approved by: re (glebius)
aemon.8
aemon.c
6d37b86f2b6abb5c0c11a9162e37ddc0ad94f01d 11-Mar-2013 sjg <sjg@FreeBSD.org> Updated dependencies
akefile.depend
0ee5295509f95c5780976697a2d3539b994458ca 16-Feb-2013 sjg <sjg@FreeBSD.org> Updated dependencies
akefile.depend
3028e3f8aba938dfd0bf9fda987b8a72140b8027 08-Feb-2013 obrien <obrien@FreeBSD.org> Sync with HEAD.
73840220f60283b92f68bd790b005505440de6e9 03-Jan-2013 marius <marius@FreeBSD.org> Remove bogus '-' from getopt(3) string hit when porting daemon(8) to
GNU/Linux *duck*.

MFC after: 1 week
aemon.c
778e93c51a9acec095f583b174c7e6692442a9aa 04-Nov-2012 sjg <sjg@FreeBSD.org> Sync from head
9dd41e3647df728006e0749ac139cfeb773c3873 22-Aug-2012 marcel <marcel@FreeBSD.org> Sync FreeBSD's bmake branch with Juniper's internal bmake branch.

Requested by: Simon Gerraty <sjg@juniper.net>
akefile.depend
3092b09c7795e1eb180d5da4adb6cbcf03a7556c 04-Jun-2012 trociny <trociny@FreeBSD.org> Document -r option in SYNOPSIS and usage statement.

Submitted by: Andrey Zonov <andrey zonov.org>
MFC after: 3 days
aemon.8
aemon.c
1300b8151a020d9fe459a88b4d4ee9c6f46e95cb 04-Jun-2012 trociny <trociny@FreeBSD.org> On a child exit, call waitpid(2) to clean up the process table.

Submitted by: Andrey Zonov <andrey zonov.org>
MFC after: 1 week
aemon.c
faf7be49ae44f552b4fc94ec07863c71eedc9668 19-Feb-2012 trociny <trociny@FreeBSD.org> If permitted protect the supervisor against pageout kill.

Suggested by: Andrey Zonov <andrey zonov org>
MFC after: 2 weeks
aemon.c
7e6fe25ca591804e5f55ce11640226a89c78d6ed 19-Feb-2012 trociny <trociny@FreeBSD.org> Add -r option to restart the program if it has been terminated.

Suggested by: Andrey Zonov <andrey zonov org>
MFC after: 2 weeks
aemon.8
aemon.c
03503d2c1ce95da32a8d84e8865164a2880f1dba 19-Feb-2012 trociny <trociny@FreeBSD.org> 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.

MFC after: 2 weeks
aemon.8
aemon.c
15a9e8816230fd94e949ae7c2b2d89774c12c511 19-Feb-2012 trociny <trociny@FreeBSD.org> 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
MFC after: 2 weeks
aemon.8
aemon.c
8685a56d47f2075e9208beb1818b857cfbacc06d 01-Feb-2012 ghelmer <ghelmer@FreeBSD.org> Change the notes about the pidfile to include Doug's preference
for pre-creating the pidfile with appropriate owner and permissions.

Requested by dougb
aemon.8
203029c5bfebcaa570e737934e67a8d964ad6cb0 25-Jan-2012 ghelmer <ghelmer@FreeBSD.org> Revert 229667: After some discussion of this change, it seems it is
better to leave the pidfile open where it was. Add a note to the
man page describing pidfile strategies to use if the daemon is to
be run as a user other than root.
aemon.8
aemon.c
cb04d194f43ed42f8c7a481a92e85c086db45df9 05-Jan-2012 ghelmer <ghelmer@FreeBSD.org> Allow daemon(8) to run pidfile_open() before relenquishing privileges
so pid files can be written in /var/run when started as root.

I do not expect this to cause any security issues, but if anyone objects
it could be easily reverted.

PR: bin/159568
MFC after: 4 weeks
aemon.c
4c8ac4b5a8251bbfbc3fe73ddafc735c7832fe78 17-May-2010 ivoras <ivoras@FreeBSD.org> Slightly improve wording.
aemon.8
073cafdd42b9cd60313d46f72dcb8893ae606832 02-Jan-2010 ed <ed@FreeBSD.org> The last big commit: let usr.sbin/ use WARNS=6 by default.
akefile
776c08f634154d991c96e6da668385a51e101203 19-Apr-2007 peter <peter@FreeBSD.org> Unbreak rev 1.7's getopt usage. The -f switch does not take an argument.
The stray ':' was from the defunct '-g' group arg.
aemon.c
ec817b37e0128dfcb48aea5f597e6dca063aa786 19-Mar-2007 trhodes <trhodes@FreeBSD.org> Improve previous commit by using setusercontext(3) and removing the group
option. Bump doc date for manual page changes.

Reviewed by: rwatson, ru, will (older version)
aemon.8
aemon.c
55ca7cf75c0d019082a4e44c3ec32a732f907846 09-Mar-2007 trhodes <trhodes@FreeBSD.org> Initialize *pfh to NULL to quiet a gcc warning, not part of my original
commit because it was not part of the new code.
aemon.c
2ade3330192c7b864335eeb4f1c5b2d034432780 09-Mar-2007 trhodes <trhodes@FreeBSD.org> Add support for dropping privileges to a specified user and/or group.

PR: 108523
Submitted by: Dmitri Alenitchev <dmitri@dworlds.ru> (original version)
Reviewed by: mpp (first reply to PR)
aemon.8
aemon.c
e8bb52f26ca47a74c30d88599fd1eb6a1a50cb92 24-Aug-2005 pjd <pjd@FreeBSD.org> Teach daemon(8) how to use pidfile(3).
akefile
aemon.8
aemon.c
6cc4b6c220d4e49fad2881c7dc754fa560248ef8 17-Jan-2005 ru <ru@FreeBSD.org> Added the EXIT STATUS section where appropriate.
aemon.8
9f45c1d92e08ca0df8a3120536812394d23d746a 07-Jul-2004 ru <ru@FreeBSD.org> mdoc(7) fixes.
aemon.8
86b461c0795331c86398e4ff65b3657463450625 02-Jun-2004 phk <phk@FreeBSD.org> Give daemon(8) the ability to create a pid-file. Since the target program
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
aemon.8
aemon.c
01f9734fe0530da4d03b90e27710d469a3114aeb 06-Jul-2003 charnier <charnier@FreeBSD.org> add FBSDID
aemon.c
a920d12f895baea61f01b199f25047011e4ff386 04-Apr-2003 obrien <obrien@FreeBSD.org> style.Makefile(5)
akefile
b2a8459286cac778b121c49cd13839b08671d037 05-Feb-2003 trhodes <trhodes@FreeBSD.org> MFS: 1.2.2.2
aemon.8
c98f3a3f5e4b253474b2fcc952dc2e9c25725a0e 31-Aug-2001 ru <ru@FreeBSD.org> mdoc(7) police: minor formatting tweaks.
aemon.8
6fa2f09167345ff3d8292e59e0dc6957a66012d4 30-Aug-2001 mike <mike@FreeBSD.org> Add a new utility that runs an executable detached from the
controlling terminal.

Discussed on: -hackers
Obtained from: BSD/OS
akefile
aemon.8
aemon.c