r69062 - in /branches/upstream/libproc-daemon-perl/current: Changes MANIFEST META.yml lib/Proc/Daemon.pm lib/Proc/Daemon.pod t/02_testmodule.t

carnil at users.alioth.debian.org carnil at users.alioth.debian.org
Sat Feb 19 07:28:43 UTC 2011


Author: carnil
Date: Sat Feb 19 07:27:39 2011
New Revision: 69062

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=69062
Log:
[svn-upgrade] new version libproc-daemon-perl (0.07)

Modified:
    branches/upstream/libproc-daemon-perl/current/Changes
    branches/upstream/libproc-daemon-perl/current/MANIFEST
    branches/upstream/libproc-daemon-perl/current/META.yml
    branches/upstream/libproc-daemon-perl/current/lib/Proc/Daemon.pm
    branches/upstream/libproc-daemon-perl/current/lib/Proc/Daemon.pod
    branches/upstream/libproc-daemon-perl/current/t/02_testmodule.t

Modified: branches/upstream/libproc-daemon-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libproc-daemon-perl/current/Changes?rev=69062&op=diff
==============================================================================
--- branches/upstream/libproc-daemon-perl/current/Changes (original)
+++ branches/upstream/libproc-daemon-perl/current/Changes Sat Feb 19 07:27:39 2011
@@ -1,41 +1,45 @@
-Revision history for Perl module Proc::Daemon.
-
-0.06  Mon Jan 17 2011
-	- A lot of documentation was add to the source code.
-	- Daemon STDIN was fixed to "read" now instead of "write".
-	- Replaced global filehandles with scalars.
-	- Add a <die> if <chdir> fails.
-	- Updated the documentation and add a note to the documentation about the
-	  behavior of process-group Signals.
-
-0.05  Thu Okt 28 2010
-	- fixed a problem when using the old method of calling Proc::Daemon::Init
-	  without object (reported by Alex Samorukov). The parent process didn't
-	  exit.
-	- fixed a problem with Proc::ProcessTable 0.44: Under some conditions
-	  'cmndline' retruns with space and/or other characters at the end.
-	- Update and small fixes in the documentation.
-
-0.04  Sun Okt 24 2010
-	- Added functions: new(), adjust_settings(), fix_filename(), Status(),
-	  Kill_Daemon(), get_pid() and get_pid_by_proc_table_attr().
-	- Init() now returns the PID of the daemon.
-	- Fork() now allways returns values like Perls built-in 'fork' does.
-	- Description was rewritten, extended and moved to the new Daemon.pod file.
-	- Additional test are done at installation.
-	- $SIG{'HUP'} was set to be valid only 'local' (bug report).
-	- POSIX::EAGAIN() was added to Fork() (bug report).
-
-0.03  Thu Jun 19 2003
-	- Licensing is more explicit: Either GPL or Artistic.
-	- Updated author contact information.
-
-0.02  Sat Apr 17 1999
-	- init() function superceded by Init() function.
-	- All open files are closed during daemonization.
-	- A double fork is now down to avoid the potential of acquiring
-	  a controlling terminal.
-	- Added Fork() and OpenMax() functions.
-
-0.01  Thu Jan 27 1998
-	- initial bundled release.
+Revision history for Perl module Proc::Daemon.
+
+0.07  Thu Feb 17 2011
+	- Add signal processing to Kill_Daemon().
+	- Updated the documentation.
+
+0.06  Mon Jan 17 2011
+	- A lot of documentation was add to the source code.
+	- Daemon STDIN was fixed to "read" now instead of "write".
+	- Replaced global filehandles with scalars.
+	- Add a <die> if <chdir> fails.
+	- Updated the documentation and add a note to the documentation about the
+	  behavior of process-group Signals.
+
+0.05  Thu Okt 28 2010
+	- fixed a problem when using the old method of calling Proc::Daemon::Init
+	  without object (reported by Alex Samorukov). The parent process didn't
+	  exit.
+	- fixed a problem with Proc::ProcessTable 0.44: Under some conditions
+	  'cmndline' retruns with space and/or other characters at the end.
+	- Update and small fixes in the documentation.
+
+0.04  Sun Okt 24 2010
+	- Added functions: new(), adjust_settings(), fix_filename(), Status(),
+	  Kill_Daemon(), get_pid() and get_pid_by_proc_table_attr().
+	- Init() now returns the PID of the daemon.
+	- Fork() now allways returns values like Perls built-in 'fork' does.
+	- Description was rewritten, extended and moved to the new Daemon.pod file.
+	- Additional test are done at installation.
+	- $SIG{'HUP'} was set to be valid only 'local' (bug report).
+	- POSIX::EAGAIN() was added to Fork() (bug report).
+
+0.03  Thu Jun 19 2003
+	- Licensing is more explicit: Either GPL or Artistic.
+	- Updated author contact information.
+
+0.02  Sat Apr 17 1999
+	- init() function superceded by Init() function.
+	- All open files are closed during daemonization.
+	- A double fork is now down to avoid the potential of acquiring
+	  a controlling terminal.
+	- Added Fork() and OpenMax() functions.
+
+0.01  Thu Jan 27 1998
+	- initial bundled release.

Modified: branches/upstream/libproc-daemon-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libproc-daemon-perl/current/MANIFEST?rev=69062&op=diff
==============================================================================
--- branches/upstream/libproc-daemon-perl/current/MANIFEST (original)
+++ branches/upstream/libproc-daemon-perl/current/MANIFEST Sat Feb 19 07:27:39 2011
@@ -1,9 +1,9 @@
-Changes
-MANIFEST
-Makefile.PL
-README
-lib/Proc/Daemon.pm
-lib/Proc/Daemon.pod
-t/01_loadmodule.t
-t/02_testmodule.t
-META.yml                                 Module meta-data (added by MakeMaker)
+Changes
+MANIFEST
+Makefile.PL
+README
+lib/Proc/Daemon.pm
+lib/Proc/Daemon.pod
+t/01_loadmodule.t
+t/02_testmodule.t
+META.yml                                 Module meta-data (added by MakeMaker)

Modified: branches/upstream/libproc-daemon-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libproc-daemon-perl/current/META.yml?rev=69062&op=diff
==============================================================================
--- branches/upstream/libproc-daemon-perl/current/META.yml (original)
+++ branches/upstream/libproc-daemon-perl/current/META.yml Sat Feb 19 07:27:39 2011
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                Proc-Daemon
-version:             0.06
+version:             0.07
 abstract:            ~
 license:             perl
 author:              

Modified: branches/upstream/libproc-daemon-perl/current/lib/Proc/Daemon.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libproc-daemon-perl/current/lib/Proc/Daemon.pm?rev=69062&op=diff
==============================================================================
--- branches/upstream/libproc-daemon-perl/current/lib/Proc/Daemon.pm (original)
+++ branches/upstream/libproc-daemon-perl/current/lib/Proc/Daemon.pm Sat Feb 19 07:27:39 2011
@@ -21,7 +21,7 @@
 use strict;
 use POSIX();
 
-$Proc::Daemon::VERSION = '0.06';
+$Proc::Daemon::VERSION = '0.07';
 
 
 ################################################################################
@@ -114,7 +114,7 @@
 
 
             # Set the new working directory.
-            chdir $self->{work_dir} or die "Can't <chdir> to $self->{work_dir}: $!";
+            die "Can't <chdir> to $self->{work_dir}: $!" unless chdir $self->{work_dir};
 
             # Clear the file creation mask.
             umask 0;
@@ -194,8 +194,8 @@
                 if ( $exec_command ) {
                     exec $exec_command;
                     exit; # Not a real exit, but needed since Perl warns you if
-                    # there is no statement like 'die', 'warn', or 'exit'
-                    # following 'exec'. The 'exec' function executes a system
+                    # there is no statement like <die>, <warn>, or <exit>
+                    # following <exec>. The <exec> function executes a system
                     # command and never returns.
                 }
 
@@ -406,11 +406,12 @@
 
 ################################################################################
 # Kill the (daemon) process:
-# Kill_Daemon( [ number or string ] )
+# Kill_Daemon( [ number or string [, SIGNAL ] ] )
 #
 # Examples:
 #   $object->Kill_Daemon() - Tries to get the PID out of the settings in new() and kill it.
-#   $object->Kill_Daemon( 12345 ) - Number of PID to kill.
+#   $object->Kill_Daemon( 12345, 'TERM' ) - Number of PID to kill with signal 'TERM'. The
+#     names or numbers of the signals are the ones listed out by kill -l on your system.
 #   $object->Kill_Daemon( './pid.txt' ) - Path to file containing one PID to kill.
 #   $object->Kill_Daemon( 'perl /home/my_perl_daemon.pl' ) - Command line entry of the
 #               running program to kill. Requires Proc::ProcessTable to work.
@@ -420,7 +421,8 @@
 ################################################################################
 sub Kill_Daemon {
     my Proc::Daemon $self = shift;
-    my $pid = shift;
+    my $pid    = shift;
+    my $signal = shift || 'KILL';
     my $pidfile;
 
     # Get the process ID.
@@ -430,7 +432,7 @@
     return 0 if ! $pid;
 
     # Kill the process.
-    my $killed = kill( 9, $pid );
+    my $killed = kill( $signal, $pid );
 
     if ( $killed && $pidfile ) {
         # Set PID in pid file to '0'.

Modified: branches/upstream/libproc-daemon-perl/current/lib/Proc/Daemon.pod
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libproc-daemon-perl/current/lib/Proc/Daemon.pod?rev=69062&op=diff
==============================================================================
--- branches/upstream/libproc-daemon-perl/current/lib/Proc/Daemon.pod (original)
+++ branches/upstream/libproc-daemon-perl/current/lib/Proc/Daemon.pod Sat Feb 19 07:27:39 2011
@@ -272,13 +272,15 @@
 =back
 
 
-=item Kill_Daemon( [ $ARG ] )
+=item Kill_Daemon( [ $ARG [, SIGNAL] ] )
 
 This function kills the Daemon process. Returns the number of processes
 successfully killed (which mostly is not the same as the PID number), or 0 if
 the process wasn't found. 
 
-$ARG is the same as of C<Status()>.
+$ARG is the same as of C<Status()>. SIGNAL is an optional signal name or number
+as required by Perls C<kill> function and listed out by C<kill -l> on your
+system. Default value is 9 ('KILL' = non-catchable, non-ignorable kill).
 
 
 =item Fork

Modified: branches/upstream/libproc-daemon-perl/current/t/02_testmodule.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libproc-daemon-perl/current/t/02_testmodule.t?rev=69062&op=diff
==============================================================================
--- branches/upstream/libproc-daemon-perl/current/t/02_testmodule.t (original)
+++ branches/upstream/libproc-daemon-perl/current/t/02_testmodule.t Sat Feb 19 07:27:39 2011
@@ -33,7 +33,7 @@
 );
 
 # create a daemon
-my $Kid_PID = $daemon->Init;
+my $Kid_PID = $daemon->init; # init instead of Init is a test for the old style too!
 
 if ( ok( $Kid_PID, "child_1 was created with PID: " . ( defined $Kid_PID ? $Kid_PID : '<undef>' ) ) || defined $Kid_PID ) {
     # here goes the child




More information about the Pkg-perl-cvs-commits mailing list