Make the daemon process a true daemon by calling setsid().
PR: bin/3202 Submitted by: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>
This commit is contained in:
parent
84c2e30193
commit
32c9dffb9d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=28613
@ -30,7 +30,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: shutdown.c,v 1.7 1997/06/19 14:28:32 charnier Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -196,6 +196,7 @@ main(argc, argv)
|
|||||||
if (forkpid)
|
if (forkpid)
|
||||||
errx(0, "[pid %d]", forkpid);
|
errx(0, "[pid %d]", forkpid);
|
||||||
}
|
}
|
||||||
|
setsid();
|
||||||
#endif
|
#endif
|
||||||
openlog("shutdown", LOG_CONS, LOG_AUTH);
|
openlog("shutdown", LOG_CONS, LOG_AUTH);
|
||||||
loop();
|
loop();
|
||||||
|
Loading…
Reference in New Issue
Block a user