r55912 - in /trunk/libapp-daemon-perl: Changes Daemon.pm META.yml Makefile.PL README debian/changelog

carnil-guest at users.alioth.debian.org carnil-guest at users.alioth.debian.org
Sat Apr 10 22:26:58 UTC 2010


Author: carnil-guest
Date: Sat Apr 10 22:26:44 2010
New Revision: 55912

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=55912
Log:
New upstream release

Modified:
    trunk/libapp-daemon-perl/Changes
    trunk/libapp-daemon-perl/Daemon.pm
    trunk/libapp-daemon-perl/META.yml
    trunk/libapp-daemon-perl/Makefile.PL
    trunk/libapp-daemon-perl/README
    trunk/libapp-daemon-perl/debian/changelog

Modified: trunk/libapp-daemon-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libapp-daemon-perl/Changes?rev=55912&op=diff
==============================================================================
--- trunk/libapp-daemon-perl/Changes (original)
+++ trunk/libapp-daemon-perl/Changes Sat Apr 10 22:26:44 2010
@@ -1,4 +1,11 @@
 Revision history for Perl extension App::Daemon.
+
+0.09 (04/09/2010)
+    (ms) Fixed find_option example on manual page. Thanks to 
+         Rolf Schaufelberger for pointing it out.
+    (ms) Added github repository link to Makefile.PL
+    (ms) Changed dropping privileges to setuid() 
+         (http://www.perlmonks.org/?node_id=833950)
 
 0.08 (11/05/2009)
     (ms) [RT 50884] Applied patch by Matthew Byng-Maddick allow overriding

Modified: trunk/libapp-daemon-perl/Daemon.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libapp-daemon-perl/Daemon.pm?rev=55912&op=diff
==============================================================================
--- trunk/libapp-daemon-perl/Daemon.pm (original)
+++ trunk/libapp-daemon-perl/Daemon.pm Sat Apr 10 22:26:44 2010
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-our $VERSION = '0.08';
+our $VERSION = '0.09';
 
 use Getopt::Std;
 use Pod::Usage;
@@ -215,7 +215,7 @@
         if(! defined $name) {
             LOGDIE "Cannot switch to user $as_user";
         }
-        $> = $uid;
+        POSIX::setuid( $uid );
     }
 }
     
@@ -485,6 +485,8 @@
     Running:     no
     Name match:  0
 
+=back
+
 =head2 Command Line Options
 
 =over 4
@@ -517,6 +519,8 @@
 Increase default Log4perl verbosity from $INFO to $DEBUG. Note that this
 option will be ignored if Log4perl is initialized independently or if
 a user-provided Log4perl configuration file is used.
+
+=back
 
 =head2 Setting Parameters
 
@@ -550,7 +554,7 @@
 
     my %opts = ();
 
-    for my $opt (qw(k P U)) {
+    for my $opt (qw(-k -P -U)) {
         my $v = App::Daemon::find_option( $opt, 1 );
         $opts{ $opt } = $v if defined $v;
     }
@@ -597,8 +601,6 @@
 continue to run the code following the detach() call but return to the
 shell prompt immediately.
 
-=back
-
 =head1 AUTHOR
 
 Mike Schilli, cpan at perlmeister.com

Modified: trunk/libapp-daemon-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libapp-daemon-perl/META.yml?rev=55912&op=diff
==============================================================================
--- trunk/libapp-daemon-perl/META.yml (original)
+++ trunk/libapp-daemon-perl/META.yml Sat Apr 10 22:26:44 2010
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               App-Daemon
-version:            0.08
+version:            0.09
 abstract:           Start an Application as a Daemon
 author:
     - Mike Schilli <m at perlmeister.com>
@@ -19,6 +19,8 @@
     Pod::Usage:          0
     Proc::ProcessTable:  0
     Test::More:          0
+resources:
+    repository:  http://github.com/mschilli/app-daemon
 no_index:
     directory:
         - t

Modified: trunk/libapp-daemon-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libapp-daemon-perl/Makefile.PL?rev=55912&op=diff
==============================================================================
--- trunk/libapp-daemon-perl/Makefile.PL (original)
+++ trunk/libapp-daemon-perl/Makefile.PL Sat Apr 10 22:26:44 2010
@@ -1,6 +1,15 @@
 use ExtUtils::MakeMaker;
 # See lib/ExtUtils/MakeMaker.pm for details of how to influence
 # the contents of the Makefile that is written.
+
+my $meta_merge = {
+    META_MERGE => {
+        resources => {
+            repository  => 'http://github.com/mschilli/app-daemon',
+        },
+    }
+};
+
 WriteMakefile(
     NAME              => 'App::Daemon',
     VERSION_FROM      => 'Daemon.pm', # finds $VERSION
@@ -14,6 +23,7 @@
         Test::More         => 0,
         File::Temp         => 0,
     }, # e.g., Module::Name => 1.1
+    $ExtUtils::MakeMaker::VERSION >= 6.50 ? (%$meta_merge) : (),
     ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
       (ABSTRACT_FROM  => 'Daemon.pm', # retrieve abstract from module
        AUTHOR         => 'Mike Schilli <m at perlmeister.com>') : ()),

Modified: trunk/libapp-daemon-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libapp-daemon-perl/README?rev=55912&op=diff
==============================================================================
--- trunk/libapp-daemon-perl/README (original)
+++ trunk/libapp-daemon-perl/README Sat Apr 10 22:26:44 2010
@@ -1,5 +1,5 @@
 ######################################################################
-    App::Daemon 0.08
+    App::Daemon 0.09
 ######################################################################
 
 NAME
@@ -107,116 +107,109 @@
             Name match:  0
 
   Command Line Options
-        -X  Foreground mode. Log messages go to the screen.
-
-        -l logfile
-            Logfile to send Log4perl messages to in background mode.
-            Defaults to "/tmp/[appname].log".
-
-        -u as_user
-            User to run as if started as root. Defaults to 'nobody'.
-
-        -l4p l4p.conf
-            Path to Log4perl configuration file. Note that in this case the
-            -v option will be ignored.
-
-        -p pidfile
-            Where to save the pid of the started process. Defaults to
-            "/tmp/[appname].pid".
-
-        -v  Increase default Log4perl verbosity from $INFO to $DEBUG. Note
-            that this option will be ignored if Log4perl is initialized
-            independently or if a user-provided Log4perl configuration file
-            is used.
+    -X  Foreground mode. Log messages go to the screen.
+
+    -l logfile
+        Logfile to send Log4perl messages to in background mode. Defaults to
+        "/tmp/[appname].log".
+
+    -u as_user
+        User to run as if started as root. Defaults to 'nobody'.
+
+    -l4p l4p.conf
+        Path to Log4perl configuration file. Note that in this case the -v
+        option will be ignored.
+
+    -p pidfile
+        Where to save the pid of the started process. Defaults to
+        "/tmp/[appname].pid".
+
+    -v  Increase default Log4perl verbosity from $INFO to $DEBUG. Note that
+        this option will be ignored if Log4perl is initialized independently
+        or if a user-provided Log4perl configuration file is used.
 
   Setting Parameters
-            Instead of setting paramteters like the logfile, the pidfile
-            etc. from the command line, you can directly manipulate
-            App::Daemon's global variables:
-
-                use App::Daemon qw(daemonize);
-
-                $App::Daemon::logfile    = "mylog.log";
-                $App::Daemon::pidfile    = "mypid.log";
-                $App::Daemon::l4p_conf   = "myconf.l4p";
-                $App::Daemon::background = 1;
-                $App::Daemon::as_user    = "nobody";
-
-                use Log::Log4perl qw(:levels);
-                $App::Daemon::loglevel   = $DEBUG;
-
-                daemonize();
+    Instead of setting paramteters like the logfile, the pidfile etc. from
+    the command line, you can directly manipulate App::Daemon's global
+    variables:
+
+        use App::Daemon qw(daemonize);
+
+        $App::Daemon::logfile    = "mylog.log";
+        $App::Daemon::pidfile    = "mypid.log";
+        $App::Daemon::l4p_conf   = "myconf.l4p";
+        $App::Daemon::background = 1;
+        $App::Daemon::as_user    = "nobody";
+
+        use Log::Log4perl qw(:levels);
+        $App::Daemon::loglevel   = $DEBUG;
+
+        daemonize();
 
   Application-specific command line options
-            If an application needs additional command line options, it can
-            use whatever is not yet taken by App::Daemon, as described
-            previously in the "Command Line Options" section.
-
-            However, it needs to make sure to remove these additional
-            options before calling daemonize(), or App::Daemon will
-            complain. To do this, create an options hash %opts and store
-            application-specific options in there while removing them from
-            @ARGV:
-
-                my %opts = ();
-
-                for my $opt (qw(k P U)) {
-                    my $v = App::Daemon::find_option( $opt, 1 );
-                    $opts{ $opt } = $v if defined $v;
-                }
-
-            After this, options "-k", "-P", and "-U" will have disappeared
-            from @ARGV and can be checked in $opts{k}, $opts{P}, and
-            $opts{U}.
+    If an application needs additional command line options, it can use
+    whatever is not yet taken by App::Daemon, as described previously in the
+    "Command Line Options" section.
+
+    However, it needs to make sure to remove these additional options before
+    calling daemonize(), or App::Daemon will complain. To do this, create an
+    options hash %opts and store application-specific options in there while
+    removing them from @ARGV:
+
+        my %opts = ();
+
+        for my $opt (qw(-k -P -U)) {
+            my $v = App::Daemon::find_option( $opt, 1 );
+            $opts{ $opt } = $v if defined $v;
+        }
+
+    After this, options "-k", "-P", and "-U" will have disappeared from
+    @ARGV and can be checked in $opts{k}, $opts{P}, and $opts{U}.
 
   Gotchas
-            If the process is started as root but later drops permissions to
-            a non-priviledged user for security purposes, it's important
-            that logfiles are created with correct permissions.
-
-            If they're created as root when the program starts, the
-            non-priviledged user won't be able to write to them later
-            (unless they're world-writable which is also undesirable because
-            of security concerns).
-
-            The best strategy to handle this case is to specify the
-            non-priviledged user as the owner of the logfile in the Log4perl
-            configuration:
-
-                log4perl.logger = DEBUG, FileApp
-                log4perl.appender.FileApp = Log::Log4perl::Appender::File
-                log4perl.appender.FileApp.filename = /var/log/foo-app.log
-                log4perl.appender.FileApp.owner    = nobody
-                log4perl.appender.FileApp.layout   = PatternLayout
-                log4perl.appender.FileApp.layout.ConversionPattern = %d %m%n
-
-            This way, the process starts up as root, creates the logfile if
-            it doesn't exist yet, and changes its owner to 'nobody'. Later,
-            when the process assumes the identity of the user 'nobody', it
-            will continue to write to the logfile without permission
-            problems.
+    If the process is started as root but later drops permissions to a
+    non-priviledged user for security purposes, it's important that logfiles
+    are created with correct permissions.
+
+    If they're created as root when the program starts, the non-priviledged
+    user won't be able to write to them later (unless they're world-writable
+    which is also undesirable because of security concerns).
+
+    The best strategy to handle this case is to specify the non-priviledged
+    user as the owner of the logfile in the Log4perl configuration:
+
+        log4perl.logger = DEBUG, FileApp
+        log4perl.appender.FileApp = Log::Log4perl::Appender::File
+        log4perl.appender.FileApp.filename = /var/log/foo-app.log
+        log4perl.appender.FileApp.owner    = nobody
+        log4perl.appender.FileApp.layout   = PatternLayout
+        log4perl.appender.FileApp.layout.ConversionPattern = %d %m%n
+
+    This way, the process starts up as root, creates the logfile if it
+    doesn't exist yet, and changes its owner to 'nobody'. Later, when the
+    process assumes the identity of the user 'nobody', it will continue to
+    write to the logfile without permission problems.
 
   Detach only
-            If you want to create a daemon without the fancy command line
-            parsing and PID file checking functions, use
-
-                use App::Daemon qw(detach);
-                detach();
-                # ... some code here
-
-            This will fork a child, terminate the parent and detach the
-            child from the terminal. Issued from the command line, the
-            program above will continue to run the code following the
-            detach() call but return to the shell prompt immediately.
+    If you want to create a daemon without the fancy command line parsing
+    and PID file checking functions, use
+
+        use App::Daemon qw(detach);
+        detach();
+        # ... some code here
+
+    This will fork a child, terminate the parent and detach the child from
+    the terminal. Issued from the command line, the program above will
+    continue to run the code following the detach() call but return to the
+    shell prompt immediately.
 
 AUTHOR
-        Mike Schilli, cpan at perlmeister.com
+    Mike Schilli, cpan at perlmeister.com
 
 COPYRIGHT AND LICENSE
-        Copyright (C) 2008 by Mike Schilli
-
-        This library is free software; you can redistribute it and/or modify
-        it under the same terms as Perl itself, either Perl version 5.8.5
-        or, at your option, any later version of Perl 5 you may have
-        available.
-
+    Copyright (C) 2008 by Mike Schilli
+
+    This library is free software; you can redistribute it and/or modify it
+    under the same terms as Perl itself, either Perl version 5.8.5 or, at
+    your option, any later version of Perl 5 you may have available.
+

Modified: trunk/libapp-daemon-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libapp-daemon-perl/debian/changelog?rev=55912&op=diff
==============================================================================
--- trunk/libapp-daemon-perl/debian/changelog (original)
+++ trunk/libapp-daemon-perl/debian/changelog Sat Apr 10 22:26:44 2010
@@ -1,3 +1,9 @@
+libapp-daemon-perl (0.09-1) UNRELEASED; urgency=low
+
+  * New upstream release
+
+ -- Salvatore Bonaccorso <salvatore.bonaccorso at gmail.com>  Sun, 11 Apr 2010 00:26:30 +0200
+
 libapp-daemon-perl (0.08-1) unstable; urgency=low
 
   * New upstream release




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