r75099 - in /branches/upstream/libproc-daemon-perl/current: Changes META.yml lib/Proc/Daemon.pm lib/Proc/Daemon.pod
carnil at users.alioth.debian.org
carnil at users.alioth.debian.org
Sat Jun 4 08:42:16 UTC 2011
Author: carnil
Date: Sat Jun 4 08:41:48 2011
New Revision: 75099
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=75099
Log:
[svn-upgrade] new version libproc-daemon-perl (0.14)
Modified:
branches/upstream/libproc-daemon-perl/current/Changes
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
Modified: branches/upstream/libproc-daemon-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libproc-daemon-perl/current/Changes?rev=75099&op=diff
==============================================================================
--- branches/upstream/libproc-daemon-perl/current/Changes (original)
+++ branches/upstream/libproc-daemon-perl/current/Changes Sat Jun 4 08:41:48 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: 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=75099&op=diff
==============================================================================
--- branches/upstream/libproc-daemon-perl/current/META.yml (original)
+++ branches/upstream/libproc-daemon-perl/current/META.yml Sat Jun 4 08:41:48 2011
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Proc-Daemon
-version: 0.13
+version: 0.14
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=75099&op=diff
==============================================================================
--- branches/upstream/libproc-daemon-perl/current/lib/Proc/Daemon.pm (original)
+++ branches/upstream/libproc-daemon-perl/current/lib/Proc/Daemon.pm Sat Jun 4 08:41:48 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: 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=75099&op=diff
==============================================================================
--- branches/upstream/libproc-daemon-perl/current/lib/Proc/Daemon.pod (original)
+++ branches/upstream/libproc-daemon-perl/current/lib/Proc/Daemon.pod Sat Jun 4 08:41:48 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