summaryrefslogtreecommitdiffstats
path: root/usr.sbin/daemon
Commit message (Collapse)AuthorAgeFilesLines
* MFC r264194:jh2014-05-091-1/+1
| | | | | | | 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
* 1. Properly clean pid files in the case of the error.trociny2013-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
* mdoc: remove EOL whitespace.joel2013-09-131-3/+3
| | | | Approved by: re (blanket)
* add support for writing the pid of the daemon program to a pid file sojmg2013-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)
* Remove bogus '-' from getopt(3) string hit when porting daemon(8) tomarius2013-01-031-1/+1
| | | | | | GNU/Linux *duck*. MFC after: 1 week
* Document -r option in SYNOPSIS and usage statement.trociny2012-06-042-3/+3
| | | | | Submitted by: Andrey Zonov <andrey zonov.org> MFC after: 3 days
* On a child exit, call waitpid(2) to clean up the process table.trociny2012-06-041-0/+4
| | | | | Submitted by: Andrey Zonov <andrey zonov.org> MFC after: 1 week
* If permitted protect the supervisor against pageout kill.trociny2012-02-191-0/+7
| | | | | Suggested by: Andrey Zonov <andrey zonov org> MFC after: 2 weeks
* Add -r option to restart the program if it has been terminated.trociny2012-02-192-22/+45
| | | | | Suggested by: Andrey Zonov <andrey zonov org> MFC after: 2 weeks
* If the supervising process receives SIGTERM, forward it to the spawnedtrociny2012-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
* The pidfile_open(3) is going to be fixed to set close-on-exec in ordertrociny2012-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
* Change the notes about the pidfile to include Doug's preferenceghelmer2012-02-011-2/+3
| | | | | | for pre-creating the pidfile with appropriate owner and permissions. Requested by dougb
* Revert 229667: After some discussion of this change, it seems it isghelmer2012-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.
* Allow daemon(8) to run pidfile_open() before relenquishing privilegesghelmer2012-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
* Slightly improve wording.ivoras2010-05-171-1/+2
|
* The last big commit: let usr.sbin/ use WARNS=6 by default.ed2010-01-021-2/+0
|
* Unbreak rev 1.7's getopt usage. The -f switch does not take an argument.peter2007-04-191-1/+1
| | | | The stray ':' was from the defunct '-g' group arg.
* Improve previous commit by using setusercontext(3) and removing the grouptrhodes2007-03-192-45/+24
| | | | | | option. Bump doc date for manual page changes. Reviewed by: rwatson, ru, will (older version)
* Initialize *pfh to NULL to quiet a gcc warning, not part of my originaltrhodes2007-03-091-1/+1
| | | | commit because it was not part of the new code.
* Add support for dropping privileges to a specified user and/or group.trhodes2007-03-092-5/+56
| | | | | | PR: 108523 Submitted by: Dmitri Alenitchev <dmitri@dworlds.ru> (original version) Reviewed by: mpp (first reply to PR)
* Teach daemon(8) how to use pidfile(3).pjd2005-08-243-11/+24
|
* Added the EXIT STATUS section where appropriate.ru2005-01-171-1/+2
|
* mdoc(7) fixes.ru2004-07-071-2/+4
|
* Give daemon(8) the ability to create a pid-file. Since the target programphk2004-06-022-6/+46
| | | | | | | | 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
* add FBSDIDcharnier2003-07-061-1/+3
|
* style.Makefile(5)obrien2003-04-041-1/+2
|
* MFS: 1.2.2.2trhodes2003-02-051-1/+1
|
* mdoc(7) police: minor formatting tweaks.ru2001-08-311-8/+8
|
* Add a new utility that runs an executable detached from themike2001-08-303-0/+158
controlling terminal. Discussed on: -hackers Obtained from: BSD/OS
OpenPOWER on IntegriCloud