r71395 - in /trunk/libproc-daemon-perl: Changes META.yml debian/changelog debian/compat debian/control lib/Proc/Daemon.pm lib/Proc/Daemon.pod
carnil at users.alioth.debian.org
carnil at users.alioth.debian.org
Mon Mar 14 07:49:22 UTC 2011
Author: carnil
Date: Mon Mar 14 07:48:50 2011
New Revision: 71395
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=71395
Log:
* New upstream release
* Bump Debhelper compat level to 8.
* debian/control: Bump versioned Build-Depends on debhelper to (>= 8).
Modified:
trunk/libproc-daemon-perl/Changes
trunk/libproc-daemon-perl/META.yml
trunk/libproc-daemon-perl/debian/changelog
trunk/libproc-daemon-perl/debian/compat
trunk/libproc-daemon-perl/debian/control
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=71395&op=diff
==============================================================================
--- trunk/libproc-daemon-perl/Changes (original)
+++ trunk/libproc-daemon-perl/Changes Mon Mar 14 07:48:50 2011
@@ -1,4 +1,9 @@
Revision history for Perl module Proc::Daemon.
+
+0.08 Sun Mar 13 2011
+ - The <open> Mode of the daemon file handles STDIN, STDOUT, STDERR can be
+ specified now. The default Mode values are the same as before.
+ - Updated the documentation.
0.07 Thu Feb 17 2011
- Add signal processing to Kill_Daemon().
Modified: trunk/libproc-daemon-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libproc-daemon-perl/META.yml?rev=71395&op=diff
==============================================================================
--- trunk/libproc-daemon-perl/META.yml (original)
+++ trunk/libproc-daemon-perl/META.yml Mon Mar 14 07:48:50 2011
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Proc-Daemon
-version: 0.07
+version: 0.08
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=71395&op=diff
==============================================================================
--- trunk/libproc-daemon-perl/debian/changelog (original)
+++ trunk/libproc-daemon-perl/debian/changelog Mon Mar 14 07:48:50 2011
@@ -1,3 +1,11 @@
+libproc-daemon-perl (0.08-1) UNRELEASED; urgency=low
+
+ * New upstream release
+ * Bump Debhelper compat level to 8.
+ * debian/control: Bump versioned Build-Depends on debhelper to (>= 8).
+
+ -- Salvatore Bonaccorso <carnil at debian.org> Mon, 14 Mar 2011 08:48:35 +0100
+
libproc-daemon-perl (0.07-1) unstable; urgency=low
* New upstream release
Modified: trunk/libproc-daemon-perl/debian/compat
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libproc-daemon-perl/debian/compat?rev=71395&op=diff
==============================================================================
--- trunk/libproc-daemon-perl/debian/compat (original)
+++ trunk/libproc-daemon-perl/debian/compat Mon Mar 14 07:48:50 2011
@@ -1,1 +1,1 @@
-7
+8
Modified: trunk/libproc-daemon-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libproc-daemon-perl/debian/control?rev=71395&op=diff
==============================================================================
--- trunk/libproc-daemon-perl/debian/control (original)
+++ trunk/libproc-daemon-perl/debian/control Mon Mar 14 07:48:50 2011
@@ -1,7 +1,7 @@
Source: libproc-daemon-perl
Section: perl
Priority: optional
-Build-Depends: debhelper (>= 7)
+Build-Depends: debhelper (>= 8)
Build-Depends-Indep: perl, libproc-processtable-perl
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Marc Haber <mh+debian-packages at zugschlus.de>,
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=71395&op=diff
==============================================================================
--- trunk/libproc-daemon-perl/lib/Proc/Daemon.pm (original)
+++ trunk/libproc-daemon-perl/lib/Proc/Daemon.pm Mon Mar 14 07:48:50 2011
@@ -21,7 +21,7 @@
use strict;
use POSIX();
-$Proc::Daemon::VERSION = '0.07';
+$Proc::Daemon::VERSION = '0.08';
################################################################################
@@ -30,9 +30,9 @@
#
# %Daemon_Settings are hash key=>values and can be:
# work_dir => '/working/daemon/directory' -> defaults to '/'
-# child_STDIN => '/path/to/daemon/STDIN.file' -> defautls to '/dev/null'
-# child_STDOUT => '/path/to/daemon/STDOUT.file' -> defaults to '/dev/null'
-# child_STDERR => '/path/to/daemon/STDERR.file' -> defaults to '/dev/null'
+# child_STDIN => '/path/to/daemon/STDIN.file' -> defautls to '</dev/null'
+# child_STDOUT => '/path/to/daemon/STDOUT.file' -> defaults to '+>/dev/null'
+# child_STDERR => '/path/to/daemon/STDERR.file' -> defaults to '+>/dev/null'
# pid_file => '/path/to/pid/file.txt' -> defaults to
# undef (= write no file)
# exec_command => 'perl /home/script.pl' -> execute a system command
@@ -185,9 +185,9 @@
# Reopen STDIN, STDOUT and STDERR to '..._path' or to /dev/null.
# Data written on a null special file is discarded. Reads from
# the null special file always return end of file.
- open( STDIN, "<", $self->{child_STDIN} || "/dev/null" );
- open( STDOUT, "+>", $self->{child_STDOUT} || "/dev/null" );
- open( STDERR, "+>", $self->{child_STDERR} || "/dev/null" );
+ open( STDIN, $self->{child_STDIN} || "</dev/null" );
+ open( STDOUT, $self->{child_STDOUT} || "+>/dev/null" );
+ open( STDERR, $self->{child_STDERR} || "+>/dev/null" );
# Execute a system command and never return.
@@ -270,17 +270,17 @@
# Set default 'work_dir' if needed.
$self->{work_dir} ||= '/';
- $self->fix_filename('child_STDIN') if $self->{child_STDIN} && $self->{child_STDIN} ne '/dev/null';
-
- $self->fix_filename('child_STDOUT') if $self->{child_STDOUT} && $self->{child_STDOUT} ne '/dev/null';
-
- $self->fix_filename('child_STDERR') if $self->{child_STDERR} && $self->{child_STDERR} ne '/dev/null';
+ $self->fix_filename( 'child_STDIN', 1 ) if $self->{child_STDIN};
+
+ $self->fix_filename( 'child_STDOUT', 1 ) if $self->{child_STDOUT};
+
+ $self->fix_filename( 'child_STDERR', 1 ) if $self->{child_STDERR};
# Check 'pid_file's name
if ( $self->{pid_file} ) {
die "Pidfile (pid_file => '$self->{pid_file}') can not be only a number. I must be able to distinguish it from a PID number in &get_pid('...')." if $self->{pid_file} =~ /^\d+$/;
- $self->fix_filename('pid_file');
+ $self->fix_filename( 'pid_file' );
}
return;
@@ -291,8 +291,10 @@
# - If the keys value is only a filename add the path of 'work_dir'.
# - If we have already set a file for this key with the same "path/name",
# add a number to the file.
-# Args: ( $self, $key )
+# Args: ( $self, $key, $extract_mode )
# key: one of 'child_STDIN', 'child_STDOUT', 'child_STDERR', 'pid_file'
+# extract_mode: 1 = separate MODE form filename before checking pathname
+# | <undef>
# Returns: nothing
################################################################################
my %memory;
@@ -300,6 +302,11 @@
my Proc::Daemon $self = shift;
my $key = shift;
my $var = $self->{ $key };
+ my $mode = '';
+ if ( shift ) {
+ $var =~ s/^([\+\<\>\-\|]+)//;
+ $mode = $1 || ( $key eq 'child_STDIN' ? '<' : '+>' );
+ }
# add path to filename
if ( $var =~ s/^\.\/// || $var !~ /\// ) {
@@ -322,7 +329,7 @@
}
$memory{ $key }{ $var } = 1;
- $self->{ $key } = $var;
+ $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=71395&op=diff
==============================================================================
--- trunk/libproc-daemon-perl/lib/Proc/Daemon.pod (original)
+++ trunk/libproc-daemon-perl/lib/Proc/Daemon.pod Mon Mar 14 07:48:50 2011
@@ -131,20 +131,23 @@
=item child_STDIN
-Defines the path to STDIN of your daemon. Defaults to C</dev/null>. Mode is '<'
-(read).
+Defines the path to STDIN of your daemon. Defaults to C</dev/null>. Default
+Mode is '<' (read). You can set your prefered Mode as if you use Perls C<open>
+with a two-argument form.
=item child_STDOUT
Defines the path where the output of your daemon will go. Defaults to
-C</dev/null>. Mode is '+>' (write/read).
+C</dev/null>. Default Mode is '+>' (write/read). You can set your prefered Mode
+as if you use Perls C<open> with a two-argument form.
=item child_STDERR
Defines the path where the error output of your daemon will go. Defaults to
-C</dev/null>. Mode is '+>' (write/read).
+C</dev/null>. Default Mode is '+>' (write/read). You can set your prefered Mode
+as if you use Perls C<open> with a two-argument form.
=item pid_file
@@ -167,7 +170,7 @@
my $daemon = Proc::Daemon->new(
work_dir => '/working/daemon/directory',
child_STDOUT => '/path/to/daemon/output.file',
- child_STDERR => 'debug.txt',
+ child_STDERR => '+>>debug.txt',
pid_file => 'pid.txt',
exec_command => 'perl /home/my_script.pl',
# or:
More information about the Pkg-perl-cvs-commits
mailing list