r75101 - in /trunk/libproc-daemon-perl: Changes META.yml debian/changelog debian/patches/pod.patch lib/Proc/Daemon.pm lib/Proc/Daemon.pod

carnil at users.alioth.debian.org carnil at users.alioth.debian.org
Sat Jun 4 08:44:36 UTC 2011


Author: carnil
Date: Sat Jun  4 08:44:12 2011
New Revision: 75101

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=75101
Log:
* New upstream release
* Refresh pod.patch.

Modified:
    trunk/libproc-daemon-perl/Changes
    trunk/libproc-daemon-perl/META.yml
    trunk/libproc-daemon-perl/debian/changelog
    trunk/libproc-daemon-perl/debian/patches/pod.patch
    trunk/libproc-daemon-perl/lib/Proc/Daemon.pm
    trunk/libproc-daemon-perl/lib/Proc/Daemon.pod

Modified: trunk/libproc-daemon-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libproc-daemon-perl/Changes?rev=75101&op=diff
==============================================================================
--- trunk/libproc-daemon-perl/Changes (original)
+++ trunk/libproc-daemon-perl/Changes Sat Jun  4 08:44:12 2011
@@ -1,4 +1,11 @@
 Revision history for Perl module Proc::Daemon.
+
+0.14  Fri Jun 03 2011
+	- The filename memory is now a part of the object (not a package variable
+	  any more). This was a bug.
+	- Since <fork> is not performed on Windows OS as on Linux, I removed the
+	  <eval> and <warn> from 0.13 and add an INFO to the documentation.
+	- Updated the documentation.
 
 0.13  Wed Jun 01 2011
 	- Add ability to define the user identifier for the daemon if you want to

Modified: trunk/libproc-daemon-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libproc-daemon-perl/META.yml?rev=75101&op=diff
==============================================================================
--- trunk/libproc-daemon-perl/META.yml (original)
+++ trunk/libproc-daemon-perl/META.yml Sat Jun  4 08:44:12 2011
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                Proc-Daemon
-version:             0.13
+version:             0.14
 abstract:            ~
 license:             perl
 author:              

Modified: trunk/libproc-daemon-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libproc-daemon-perl/debian/changelog?rev=75101&op=diff
==============================================================================
--- trunk/libproc-daemon-perl/debian/changelog (original)
+++ trunk/libproc-daemon-perl/debian/changelog Sat Jun  4 08:44:12 2011
@@ -1,3 +1,10 @@
+libproc-daemon-perl (0.14-1) UNRELEASED; urgency=low
+
+  * New upstream release
+  * Refresh pod.patch.
+
+ -- Salvatore Bonaccorso <carnil at debian.org>  Sat, 04 Jun 2011 10:43:59 +0200
+
 libproc-daemon-perl (0.13-1) unstable; urgency=low
 
   * New upstream release

Modified: trunk/libproc-daemon-perl/debian/patches/pod.patch
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libproc-daemon-perl/debian/patches/pod.patch?rev=75101&op=diff
==============================================================================
--- trunk/libproc-daemon-perl/debian/patches/pod.patch (original)
+++ trunk/libproc-daemon-perl/debian/patches/pod.patch Sat Jun  4 08:44:12 2011
@@ -4,7 +4,7 @@
 Forwarded: no
 --- a/lib/Proc/Daemon.pod
 +++ b/lib/Proc/Daemon.pod
-@@ -141,7 +141,7 @@
+@@ -144,7 +144,7 @@
  
  Sets the real user identifier (C<< $< >>) and the effective user identifier
  (C<< $> >>) for the daemon process using C<POSIX::setuid( ... )>, in case you

Modified: trunk/libproc-daemon-perl/lib/Proc/Daemon.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libproc-daemon-perl/lib/Proc/Daemon.pm?rev=75101&op=diff
==============================================================================
--- trunk/libproc-daemon-perl/lib/Proc/Daemon.pm (original)
+++ trunk/libproc-daemon-perl/lib/Proc/Daemon.pm Sat Jun  4 08:44:12 2011
@@ -21,9 +21,7 @@
 use strict;
 use POSIX();
 
-$Proc::Daemon::VERSION = '0.13';
-
-my %memory;
+$Proc::Daemon::VERSION = '0.14';
 
 
 ################################################################################
@@ -54,6 +52,8 @@
     my $self = \%args;
     bless( $self, $class );
 
+    $self->{memory} = {};
+
     return $self;
 }
 
@@ -154,12 +154,9 @@
             # Clear the file creation mask.
             umask 0;
 
-            # Detach the child from the terminal (no controlling tty), make it
-            # the session-leader and the process-group-leader of a new process
-            # group. Some (Windows) OS do not support POSIX::setsid(). This is
-            # the reason for the <eval> here. In this case we only <warn>.
-            die "Cannot detach from controlling terminal" if ( eval{ POSIX::setsid() } || 0 ) < 0;
-            warn "Cannot detach from controlling terminal with POSIX::setsid(): $@" if $@;
+            # Detach the child from the terminal (no controlling tty), make it the
+            # session-leader and the process-group-leader of a new process group.
+            die "Cannot detach from controlling terminal" if POSIX::setsid() < 0;
 
             # "Is ignoring SIGHUP necessary?
             #
@@ -324,8 +321,8 @@
         @pid = map { chomp $_; $_ eq '' ? undef : $_ } <$FH_MEMORY>;
         close $FH_MEMORY;
     }
-    else {
-        foreach ( keys %{ $memory{'pid_file'} } ) {
+    elsif ( $self->{memory}{pid_file} ) {
+        foreach ( keys %{ $self->{memory}{pid_file} } ) {
             open( $FH_MEMORY, "<", $_ ) || die "Can not open pid_file '<$_': $!";
             push( @pid, <$FH_MEMORY> );
             close $FH_MEMORY;
@@ -391,19 +388,19 @@
 
     # If the file was already in use, modify it with '_number':
     # filename_X | filename_X.ext
-    if ( $memory{ $key }{ $var } ) {
+    if ( $self->{memory}{ $key }{ $var } ) {
         $var =~ s/([^\/]+)$//;
         my @i = split( /\./, $1 );
         my $j = $#i ? $#i - 1 : 0;
 
-        $memory{ "$key\_num" } ||= 0;
-        $i[ $j ] =~ s/_$memory{ "$key\_num" }$//;
-        $memory{ "$key\_num" }++;
-        $i[ $j ] .= '_' . $memory{ "$key\_num" };
+        $self->{memory}{ "$key\_num" } ||= 0;
+        $i[ $j ] =~ s/_$self->{memory}{ "$key\_num" }$//;
+        $self->{memory}{ "$key\_num" }++;
+        $i[ $j ] .= '_' . $self->{memory}{ "$key\_num" };
         $var .= join( '.', @i );
     }
 
-    $memory{ $key }{ $var } = 1;
+    $self->{memory}{ $key }{ $var } = 1;
     $self->{ $key } = $mode . $var;
 
     return;

Modified: trunk/libproc-daemon-perl/lib/Proc/Daemon.pod
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libproc-daemon-perl/lib/Proc/Daemon.pod?rev=75101&op=diff
==============================================================================
--- trunk/libproc-daemon-perl/lib/Proc/Daemon.pod (original)
+++ trunk/libproc-daemon-perl/lib/Proc/Daemon.pod Sat Jun  4 08:44:12 2011
@@ -67,8 +67,7 @@
 =item 4
 
 The child becomes a session leader, which detaches the program from the
-controlling terminal. Windows OS mostly do not perform this action, Proc::Daemon
-will C<warn> you about this.
+controlling terminal.
 
 
 =item 5
@@ -115,6 +114,10 @@
 therefore Signals will not be send to other members of his process group. If
 you need the functionality of a session-leader you may want to call
 POSIX::setsid() manually at your daemon.
+
+
+INFO: Since C<fork> is not performed the same way on Windows systems as on
+Linux, this module does not work with Windows. Patches appreciated!
 
 
 




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