Daemon::Simple - Perl extension for making script as daemon with start|stop controlling on unix system
use Daemon::Simple; Daemon::Simple::init($command); or Daemon::Simple::init($command,"~/"); or my $homedir = `pwd`; chomp($homedir); my $pidfile = "/var/run/ffencoder.pid"; my $command = $ARGV[0]; Daemon::Simple::init($command,$homedir,$pidfile); ## Daemon script ## open(FILE,">out.txt"); select(FILE); sleep(10); close(FILE); __END__ # in shell $ perl foo.pl start $ perl foo.pl stop
This module is good for making a script as a daemon. A daemon script has start|stop controlling command. It is simple by adding Daemon::Simple::init() on first line of script.
This module is implemented by wrapping Proc::Daemon.
None by default.
Proc::Daemon
Proc::ProcessTable
HyeonSeung Kim, <sng2nara@hanmail.net>
Copyright (C) 2007 by sng2nara
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
1 POD Error
The following errors were encountered while parsing the POD:
=cut found outside a pod block. Skipping to next block.
To install Daemon::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Daemon::Simple
CPAN shell
perl -MCPAN -e shell install Daemon::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.