Commit a07a6d1b authored by Salvatore Bonaccorso's avatar Salvatore Bonaccorso

new upstream release

parent 6d03b8c5
Revision history for Perl extension App::Daemon.
0.11 (08/28/2010)
(ms) Fixed test suite.
0.10 (08/19/2010)
(ms) Writing pid file before dropping privileges (just like logfile).
......
......@@ -2,7 +2,7 @@ package App::Daemon;
use strict;
use warnings;
our $VERSION = '0.10';
our $VERSION = '0.11';
use Getopt::Std;
use Pod::Usage;
......
--- #YAML:1.0
name: App-Daemon
version: 0.10
version: 0.11
abstract: Start an Application as a Daemon
author:
- Mike Schilli <m@perlmeister.com>
......
######################################################################
App::Daemon 0.10
App::Daemon 0.11
######################################################################
NAME
......
libapp-daemon-perl (0.10-1) UNRELEASED; urgency=low
libapp-daemon-perl (0.11-1) UNRELEASED; urgency=low
* New upstream release
* Refresh debian/copyright: Explicitly refer to GPL-1 license text in
......
use Test::More tests => 4;
use Test::More tests => 3;
use App::Daemon qw(daemonize cmd_line_parse);
use File::Temp qw(tempfile);
use Fcntl qw/:flock/;
use Log::Log4perl qw(:easy);
Log::Log4perl->easy_init({ level => $DEBUG, layout => "%F-%L> %m%n" });
my($fh, $tempfile) = tempfile();
my($pf, $pidfile) = tempfile();
# Turdix locks temp files, so unlock them just in case
flock $fh, LOCK_UN;
flock $pf, LOCK_UN;
ok(1, "loaded ok");
open(OLDERR, ">&STDERR");
open(STDERR, ">$tempfile");
@ARGV = ("-X", "-p", $pidfile);
@ARGV = ("-X");
daemonize();
close STDERR;
open(STDERR, ">&OLDERR");
close OLDERR;
ok(1, "running in foreground with -X");
open PIDFILE, "<$pidfile";
my $pid = <PIDFILE>;
chomp $pid;
close PIDFILE;
is($pid, $$, "check pid");
ok(1, "Running in foreground with -X");
open FILE, "<$tempfile";
open FILE, "<$tempfile" or
die "Cannot open tempfile $tempfile ($!)";
my $data = join '', <FILE>;
close FILE;
like($data, qr/Written to $pidfile/, "log message");
like($data, qr/Running in foreground/, "log message");
use Test::More tests => 4;
use Test::More tests => 3;
use App::Daemon qw(daemonize cmd_line_parse);
use File::Temp qw(tempfile);
use Fcntl qw/:flock/;
use Log::Log4perl qw(:easy);
Log::Log4perl->easy_init({ level => $DEBUG, layout => "%F-%L> %m%n" });
my($fh, $tempfile) = tempfile();
my($pf, $pidfile) = tempfile();
# Turdix locks temp files, so unlock them just in case
flock $fh, LOCK_UN;
flock $pf, LOCK_UN;
ok(1, "loaded ok");
......@@ -18,7 +19,6 @@ open(STDERR, ">$tempfile");
@ARGV = ();
$App::Daemon::background = 0;
$App::Daemon::pidfile = $pidfile;
daemonize();
close STDERR;
......@@ -27,15 +27,8 @@ close OLDERR;
ok(1, "running in foreground");
open PIDFILE, "<$pidfile";
my $pid = <PIDFILE>;
chomp $pid;
close PIDFILE;
is($pid, $$, "check pid");
open FILE, "<$tempfile";
my $data = join '', <FILE>;
close FILE;
like($data, qr/Written to $pidfile/, "log message");
like($data, qr/Running in foreground/, "log message");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment