Daemon-Control icon indicating copy to clipboard operation
Daemon-Control copied to clipboard

Generate basic D::C Script with D::C!

Open symkat opened this issue 12 years ago • 0 comments

perl -MDaemon::Control -e'mk_init "script_name.pl", "Application Name"'; should generate a new script that looks like this:

#!/usr/bin/perl
use warnings;
use strict;
use Daemon::Control;


Daemon::Control->new({
    name         => "Application Name",
    lsb_start    => '$local_fs $network',
    lsb_stop     => '$local_fs $network',
    lsb_sdesc    => 'Application Name Short Description',
    lsb_desc     => 'Application Name Description',
    path         => '/home/symkat/DCP',

    program      => '',
    program_args => [qw( )],

    pid_file     => '/tmp/script_name',

    stderr_file => "/dev/null",
    stdout_file => "/dev/null",
    #stderr_file  => '/tmp/script_name_err.log',
    #stdout_file  => '/tmp/script_name_out.log',

    fork         => 2,

})->run;

I think these are sensible defaults to take away some of the more boiler plate bits of writing the script. What do you guys think of the proposed defaults? I'm also open to dropping in a script/ and making dc_make_init or some such script.

symkat avatar Nov 28 '13 18:11 symkat