Giter Site home page Giter Site logo

system-daemon's Introduction

System::Daemon

NAME

System::Daemon

DESCRIPTION

Swiss-knife for daemonization

SYNOPSIS

See liittle example:

use System::Daemon;

$0 = 'my_daemon_process_name';

my $daemon = System::Daemon->new(
user            =>  'username',
group           =>  'groupname',
pidfile         =>  'path/to/pidfile',
name_pattern    =>  'my_daemon_process_name'
);
$daemon->daemonize();

your_cool_code();

$daemon->exit(0);

METHODS

new(%params)

Constructor, returns System::Daemon object. Available parameters:

  • user => desired username
  • group => desired groupname
  • pidfile => '/path/to/pidfile'
  • name_pattern => name pattern to look if ps output,

daemonize

Call it to become a daemon.

exit($exit_code)

An exit wrapper, also, it performing cleanup before exit.

finish

Performing cleanup. At now cleanup is just pid file removing.

cleanup

Same as finish.

process_object

Returns System::Process object of daemon instance.

system-daemon's People

Contributors

justnoxx avatar manwar avatar

Watchers

James Cloos avatar  avatar

Forkers

manwar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.