aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/daemon
Commit message (Collapse)AuthorAgeFilesLines
* Bump .Dd for earlier update (should have been part of r353024).Ian Lepore2019-10-021-1/+1
| | | | Notes: svn path=/head/; revision=353025
* Clarify how the -f option for daemon(8) interacts with other optionsIan Lepore2019-10-021-0/+5
| | | | | | | related to redirecting stdout and stderr. Notes: svn path=/head/; revision=353024
* daemon(8): Don't block SIGTERM during restart delayConrad Meyer2019-06-041-2/+4
| | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=348629
* Correct contradictory information on default syslog logging priority.Michael Gmelin2019-03-251-2/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=345512
* Cross-reference nohup(1) and daemon(8).Mateusz Piotrowski2018-11-091-1/+2
| | | | | | | | | Reviewed by: bcr Approved by: krion (mentor, implicit), mat (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D17920 Notes: svn path=/head/; revision=340283
* Add a missing "Ar" macro to the description of the -R flag in the manpage.Mateusz Piotrowski2018-08-011-2/+2
| | | | | | | | Approved by: bjk (doc committer), krion (mentor) Differential Revision: https://reviews.freebsd.org/D16520 Notes: svn path=/head/; revision=337040
* Fix cut-and-pasted line to have the right option letter.Ian Lepore2018-04-161-2/+2
| | | | | | | | Reported by: 0mp@ Pointy hat: ian@ Notes: svn path=/head/; revision=332527
* Add an option to daemon(8) to specify a delay between restarts of aIan Lepore2018-04-152-5/+15
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=332518
* o A command line flag for the syslog_facility fixed in the SYNOPSIS.Maxim Konovalov2018-01-261-1/+1
| | | | | | | PR: 225441 Notes: svn path=/head/; revision=328434
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=326276
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2016-11-131-0/+1
| | | | | | | | MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=308606
* daemon: Allow logging daemon stdout/stderr to file or syslog.Jilles Tjoelker2016-10-222-112/+446
| | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=307769
* o -t comman line option added to the usage().Maxim Konovalov2016-03-031-3/+3
| | | | Notes: svn path=/head/; revision=296339
* daemon(8): Add -t option to set process titleConrad Meyer2016-03-022-6/+16
| | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=296321
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-271-2/+1
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * Merge headSimon J. Gerraty2014-04-281-1/+1
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265044
| * \ Merge head@256284Simon J. Gerraty2013-10-132-31/+101
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=256424
| * | | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | | Sync with HEAD.David E. O'Brien2013-02-081-1/+1
| |\ \ \ | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246555
| * \ \ \ Sync from headSimon J. Gerraty2012-11-042-3/+7
| |\ \ \ \ | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=242545
| * | | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | | | Convert usr.sbin to LIBADDBaptiste Daroussin2014-11-251-2/+1
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduce overlinking Notes: svn path=/head/; revision=275054
* | | | | Fork a child process and wait until the process terminates when the -PJaakko Heinonen2014-04-061-1/+1
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | option is specified. This behavior is documented on the manual page. PR: bin/187265 Submitted by: Kimo R MFC after: 2 weeks Notes: svn path=/head/; revision=264194
* | | | 1. Properly clean pid files in the case of the error.Mikolaj Golub2013-09-191-18/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=255707
* | | | mdoc: remove EOL whitespace.Joel Dahl2013-09-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Approved by: re (blanket) Notes: svn path=/head/; revision=255526
* | | | add support for writing the pid of the daemon program to a pid file soJohn-Mark Gurney2013-09-132-19/+80
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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) Notes: svn path=/head/; revision=255521
* | | Remove bogus '-' from getopt(3) string hit when porting daemon(8) toMarius Strobl2013-01-031-1/+1
| |/ |/| | | | | | | | | | | | | | | GNU/Linux *duck*. MFC after: 1 week Notes: svn path=/head/; revision=244986
* | Document -r option in SYNOPSIS and usage statement.Mikolaj Golub2012-06-042-3/+3
| | | | | | | | | | | | | | | | Submitted by: Andrey Zonov <andrey zonov.org> MFC after: 3 days Notes: svn path=/head/; revision=236551
* | On a child exit, call waitpid(2) to clean up the process table.Mikolaj Golub2012-06-041-0/+4
|/ | | | | | | | Submitted by: Andrey Zonov <andrey zonov.org> MFC after: 1 week Notes: svn path=/head/; revision=236550
* If permitted protect the supervisor against pageout kill.Mikolaj Golub2012-02-191-0/+7
| | | | | | | | Suggested by: Andrey Zonov <andrey zonov org> MFC after: 2 weeks Notes: svn path=/head/; revision=231912
* Add -r option to restart the program if it has been terminated.Mikolaj Golub2012-02-192-22/+45
| | | | | | | | Suggested by: Andrey Zonov <andrey zonov org> MFC after: 2 weeks Notes: svn path=/head/; revision=231911
* If the supervising process receives SIGTERM, forward it to the spawnedMikolaj Golub2012-02-192-11/+72
| | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=231910
* The pidfile_open(3) is going to be fixed to set close-on-exec in orderMikolaj Golub2012-02-192-26/+58
| | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=231909
* Change the notes about the pidfile to include Doug's preferenceGuy Helmer2012-02-011-2/+3
| | | | | | | | | for pre-creating the pidfile with appropriate owner and permissions. Requested by dougb Notes: svn path=/head/; revision=230869
* Revert 229667: After some discussion of this change, it seems it isGuy Helmer2012-01-252-3/+7
| | | | | | | | | 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. Notes: svn path=/head/; revision=230541
* Allow daemon(8) to run pidfile_open() before relenquishing privilegesGuy Helmer2012-01-051-3/+3
| | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=229667
* Slightly improve wording.Ivan Voras2010-05-171-1/+2
| | | | Notes: svn path=/head/; revision=208190
* The last big commit: let usr.sbin/ use WARNS=6 by default.Ed Schouten2010-01-021-2/+0
| | | | Notes: svn path=/head/; revision=201390
* Unbreak rev 1.7's getopt usage. The -f switch does not take an argument.Peter Wemm2007-04-191-1/+1
| | | | | | | The stray ':' was from the defunct '-g' group arg. Notes: svn path=/head/; revision=168868
* Improve previous commit by using setusercontext(3) and removing the groupTom Rhodes2007-03-192-45/+24
| | | | | | | | | option. Bump doc date for manual page changes. Reviewed by: rwatson, ru, will (older version) Notes: svn path=/head/; revision=167700
* Initialize *pfh to NULL to quiet a gcc warning, not part of my originalTom Rhodes2007-03-091-1/+1
| | | | | | | commit because it was not part of the new code. Notes: svn path=/head/; revision=167357
* Add support for dropping privileges to a specified user and/or group.Tom Rhodes2007-03-092-5/+56
| | | | | | | | | PR: 108523 Submitted by: Dmitri Alenitchev <dmitri@dworlds.ru> (original version) Reviewed by: mpp (first reply to PR) Notes: svn path=/head/; revision=167356
* Teach daemon(8) how to use pidfile(3).Pawel Jakub Dawidek2005-08-243-11/+24
| | | | Notes: svn path=/head/; revision=149424
* Added the EXIT STATUS section where appropriate.Ruslan Ermilov2005-01-171-1/+2
| | | | Notes: svn path=/head/; revision=140368