r46851 - in /branches/upstream/libapp-daemon-perl/current: Changes Daemon.pm META.yml README

carnil-guest at users.alioth.debian.org carnil-guest at users.alioth.debian.org
Fri Nov 6 19:57:01 UTC 2009


Author: carnil-guest
Date: Fri Nov  6 19:56:48 2009
New Revision: 46851

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=46851
Log:
[svn-upgrade] Integrating new upstream version, libapp-daemon-perl (0.08)

Modified:
    branches/upstream/libapp-daemon-perl/current/Changes
    branches/upstream/libapp-daemon-perl/current/Daemon.pm
    branches/upstream/libapp-daemon-perl/current/META.yml
    branches/upstream/libapp-daemon-perl/current/README

Modified: branches/upstream/libapp-daemon-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-daemon-perl/current/Changes?rev=46851&op=diff
==============================================================================
--- branches/upstream/libapp-daemon-perl/current/Changes (original)
+++ branches/upstream/libapp-daemon-perl/current/Changes Fri Nov  6 19:56:48 2009
@@ -1,14 +1,19 @@
 Revision history for Perl extension App::Daemon.
 
-0.08 (10/08/2009)
-    (ms) [RT 50326] Fixed insecure dependency error in tainted mode
-         by untainting the string obtained by appname().
+0.08 (11/05/2009)
+    (ms) [RT 50884] Applied patch by Matthew Byng-Maddick allow overriding
+         app-internal option settings by command line options. Order is now:
+         command line > app-internal > App::Daemon internal
+    (ms) [RT 51066] Applied patch by Mike Whitaker to point stdin/out/err 
+         to /dev/null instead of closing them.
 
-0.07 (03/24/2009)
+0.07 (10/08/2009)
     (ms) Applied patch by Sadrak [rt:44513] to check if Log4perl has
          already been initialized and skip the easy_init call in this
          case. Note that -v then has to be handled by the user-provided 
          Log4perl configuration instead.
+    (ms) [RT 50326] Fixed insecure dependency error in tainted mode
+         by untainting the string obtained by appname().
 
 0.06 (03/05/2009)
     (ms) Added detach() as an importable method for simple daemons.

Modified: branches/upstream/libapp-daemon-perl/current/Daemon.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-daemon-perl/current/Daemon.pm?rev=46851&op=diff
==============================================================================
--- branches/upstream/libapp-daemon-perl/current/Daemon.pm (original)
+++ branches/upstream/libapp-daemon-perl/current/Daemon.pm Fri Nov  6 19:56:48 2009
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-our $VERSION = '0.07';
+our $VERSION = '0.08';
 
 use Getopt::Std;
 use Pod::Usage;
@@ -30,20 +30,29 @@
         pod2usage();
     }
 
-    if(!defined $pidfile) {
-      $pidfile    = find_option('-p', 1) || ( '/tmp/' . $appname . ".pid" );
-    }
-
-    if(!defined $logfile) {
-      $logfile    = find_option('-l', 1) || ( '/tmp/' . $appname . ".log" );
-    }
-
-    if(!defined $l4p_conf) {
-      $l4p_conf   = find_option('-l4p', 1);
-    }
-
-    if(!defined $as_user) {
-      $as_user    = find_option('-u', 1) || "nobody";
+    if(my $_pidfile = find_option('-p', 1)) {
+      $pidfile    = $_pidfile;
+    }
+    else {
+      $pidfile  ||= ( '/tmp/' . $appname . ".pid" );
+    }
+
+    if(my $_logfile = find_option('-l', 1)) {
+      $logfile    = $_logfile;
+    }
+    else {
+      $logfile  ||= ( '/tmp/' . $appname . ".log" );
+    }
+
+    if(my $_l4p_conf = find_option('-l4p', 1)) {
+      $l4p_conf   = $_l4p_conf;
+    }
+
+    if(my $_as_user = find_option('-u', 1)) {
+      $as_user    = $_as_user;
+    }
+    else {
+      $as_user  ||= 'nobody';
     }
 
     if($> != 0) {
@@ -51,14 +60,12 @@
         ($as_user) = getpwuid($>);
     }
 
-    if(!defined $background) {
-      $background = find_option('-X') ? 0 : 1,
-    }
-
-    if(!defined $loglevel) {
-      $loglevel   = find_option('-v') ? $DEBUG : $INFO;
-      $loglevel   = $DEBUG if !$background;
-    }
+    $background = 1 if(!defined $background);
+    $background = find_option('-X') ? 0 : $background;
+
+    $loglevel   = $background ? $INFO : $DEBUG
+      if(!defined $loglevel);
+    $loglevel   = find_option('-v') ? $DEBUG : $loglevel;
 
     for (qw(start stop status)) {
         if( find_option( $_ ) ) {
@@ -184,9 +191,19 @@
     }
  
         # close std file descriptors
-    close(STDIN);
-    close(STDOUT);
-    close(STDERR);
+    if(-e "/dev/null") {
+        # On Unix, we want to point these file descriptors at /dev/null,
+        # so that any libary routines that try to read form stdin or
+        # write to stdout/err will have no effect (Stevens, APitUE, p. 426
+        # and [RT 51066].
+        open STDIN, '/dev/null';
+        open STDOUT, '>>/dev/null';
+        open STDERR, '>>/dev/null';
+    } else {
+        close(STDIN);
+        close(STDOUT);
+        close(STDERR);
+    }
 }
 
 ###########################################

Modified: branches/upstream/libapp-daemon-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-daemon-perl/current/META.yml?rev=46851&op=diff
==============================================================================
--- branches/upstream/libapp-daemon-perl/current/META.yml (original)
+++ branches/upstream/libapp-daemon-perl/current/META.yml Fri Nov  6 19:56:48 2009
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               App-Daemon
-version:            0.07
+version:            0.08
 abstract:           Start an Application as a Daemon
 author:
     - Mike Schilli <m at perlmeister.com>

Modified: branches/upstream/libapp-daemon-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-daemon-perl/current/README?rev=46851&op=diff
==============================================================================
--- branches/upstream/libapp-daemon-perl/current/README (original)
+++ branches/upstream/libapp-daemon-perl/current/README Fri Nov  6 19:56:48 2009
@@ -1,5 +1,5 @@
 ######################################################################
-    App::Daemon 0.07
+    App::Daemon 0.08
 ######################################################################
 
 NAME




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