Commit 79e58509 authored by Salvatore Bonaccorso's avatar Salvatore Bonaccorso

[svn-upgrade] new version libapp-daemon-perl (0.10)

parent d5ab362b
Revision history for Perl extension App::Daemon.
0.10 (08/19/2010)
(ms) Writing pid file before dropping privileges (just like logfile).
0.09 (04/09/2010)
(ms) Fixed find_option example on manual page. Thanks to
Rolf Schaufelberger for pointing it out.
......
......@@ -2,7 +2,7 @@ package App::Daemon;
use strict;
use warnings;
our $VERSION = '0.09';
our $VERSION = '0.10';
use Getopt::Std;
use Pod::Usage;
......@@ -82,9 +82,6 @@ sub cmd_line_parse {
DEBUG "Log4perl already initialized, doing nothing";
} elsif( $l4p_conf ) {
Log::Log4perl->init( $l4p_conf );
} elsif( !$background ) {
Log::Log4perl->easy_init({ level => $loglevel,
layout => "%F{1}-%L: %m%n" });
} elsif( $logfile ) {
my $levelstring = Log::Log4perl::Level::to_level( $loglevel );
Log::Log4perl->init(\ qq{
......@@ -134,6 +131,7 @@ sub daemonize {
if($action eq "restart") {
sleep 1;
} else {
INFO "Process $$ stopped by request.";
exit 0;
}
}
......@@ -153,10 +151,6 @@ sub daemonize {
}
};
INFO "Process ID is $$";
pid_file_write($$);
INFO "Written to $pidfile";
return 1;
}
......@@ -167,7 +161,7 @@ sub detach {
umask(0);
# Make sure the child isn't killed when the uses closes the
# Make sure the child isn't killed when the user closes the
# terminal session before the child detaches from the tty.
$SIG{'HUP'} = 'IGNORE';
......@@ -186,6 +180,10 @@ sub detach {
# process group leader of a new process group.
POSIX::setsid();
INFO "Process ID is $$";
pid_file_write($$);
INFO "Written to $pidfile";
if($as_user) {
user_switch();
}
......
--- #YAML:1.0
name: App-Daemon
version: 0.09
version: 0.10
abstract: Start an Application as a Daemon
author:
- Mike Schilli <m@perlmeister.com>
......@@ -25,7 +25,7 @@ no_index:
directory:
- t
- inc
generated_by: ExtUtils::MakeMaker version 6.50
generated_by: ExtUtils::MakeMaker version 6.55_02
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
######################################################################
App::Daemon 0.09
App::Daemon 0.10
######################################################################
NAME
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment