Akira Horimoto > App-CLI-Plugin-Daemonize-1.0 > App::CLI::Plugin::Daemonize

Download:
App-CLI-Plugin-Daemonize-1.0.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 1.0   Source  

NAME ^

App::CLI::Plugin::Daemonize - for App::CLI::Plugin::Extension daemonize plugin module

VERSION ^

1.0

SYNOPSIS ^

  # MyApp.pm
  package MyApp;
  
  use strict;
  use base qw(App::CLI::Extension);
  
  # extension method
  __PACKAGE__->load_plugins(qw(Daemonize));
  
  # extension method
  __PACKAGE__->config( deemonize => 1 );
  
  1;
  
  # MyApp/Daemonize.pm
  package MyApp::Daemonize;
  
  use strict;
  use base qw(App::CLI::Command);
  
  sub options { return ("daemonize" => "daemonize") };
  
  sub run {
          
      my($self, @argv) = @_;
      # anything to do...
  }
  
  1;
  
  # myapp
  #!/usr/bin/perl
  
  use strict;
  use MyApp;
  
  MyApp->dispatch;
  
  # daemon execute
  [kurt@localhost ~] ./myapp daemonize

DESCRIPTION ^

App::CLI::Plugin::Daemonize - daemonize plugin module

daemonize method setting

  # enable daemonize
  __PACKAGE__->config( daemonize => 1 );

or if --daemonize option is defined. it applies.

  # in MyApp/**.pm
  sub options {
      return ( "daemonize" => "daemonize" ) ;
  }
  
  # execute
  [kurt@localhost ~] ./myapp daemonize --daemonize

METHOD ^

daemonize

Enable daemonize. It usually runs in the setup method, no explicit attempt to

AUTHOR ^

Akira Horimoto

SEE ALSO ^

App::CLI::Extension

LICENSE ^

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

COPYRIGHT ^

Copyright (C) 2010 Akira Horimoto

syntax highlighting: