MichaelMeyer has asked for the wisdom of the Perl Monks concerning the following question:
Could anyone help out?use Daemon::Simple; $prog_name = 'some_prog'; ## Initialize Daemon ## my $homedir = '/'; my $pidfile = "/var/run/$prog_name.pid"; my $command = $ARGV[0]; Daemon::Simple::init($command,$homedir,$pidfile); ## Daemon script ## open LOG, ">>$log_file"; # $log_file contains an absolute path print LOG "$prog_name started."; ## Daemon Loop ## while (1) { print LOG "before sleep..."; sleep(1); print LOG "after sleep..."; } close LOG; __END__
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Daemon problem with sleep()
by almut (Canon) on Dec 17, 2008 at 12:08 UTC | |
by MichaelMeyer (Novice) on Dec 17, 2008 at 12:38 UTC | |
by targetsmart (Curate) on Dec 17, 2008 at 14:28 UTC | |
|
Re: Daemon problem with sleep()
by zentara (Cardinal) on Dec 17, 2008 at 12:13 UTC | |
by almut (Canon) on Dec 17, 2008 at 12:26 UTC | |
by ikegami (Patriarch) on Dec 17, 2008 at 14:13 UTC | |
by Lawliet (Curate) on Dec 17, 2008 at 19:38 UTC | |
by ikegami (Patriarch) on Dec 17, 2008 at 19:53 UTC |