#!/usr/bin/perl use strict; use warnings; use POSIX qw(setsid); # Become a daemon my $pid=fork; exit if $pid; # Parent exits here die "Couldn't fork $!" unless defined($pid); die "Couldn't start new session $!" unless POSIX::setsid(); # Do your daemon bit...
In reply to Re: Answer: Is it possible to background a perl script from within itself?
by hbo
in thread Is it possible to background a perl script from within itself?
by reyjrar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |