File: 03_perl_gets_control.pl

package info (click to toggle)
libdaemon-control-perl 0.000009-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 232 kB
  • sloc: perl: 1,623; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 695 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/perl
use warnings;
use strict;
use Daemon::Control;

Daemon::Control->new({
    name        => "My Daemon",
    lsb_start   => '$syslog $remote_fs',
    lsb_stop    => '$syslog',
    lsb_sdesc   => 'My Daemon Short',
    lsb_desc    => 'My Daemon controls the My Daemon daemon.',
    path        => '/usr/sbin/mydaemon/init.pl',

    program     => sub { 
        if ( ref $_[0] ne 'Daemon::Control' ) {
            print "FAILED\n";
        }
    },
    program_args => [ ],

    redirect_before_fork => 0,
    pid_file    => '/dev/null', # I don't want to leave tmp files for testing.
    stderr_file => '/dev/null',
    stdout_file => '/dev/null',

    fork        => 2,

})->run;