-#!/usr/bin/perl
-
use strict;
use warnings;
use File::Spec::Functions;
with qw(MooseX::Daemonize);
has filename => ( isa => 'Str', is => 'ro' );
-
- after start => sub {
+
+ after start => sub {
my $self = shift;
if ($self->is_daemon) {
$self->create_file( $self->filename );
}
my $app = FileMaker->new(
- pidbase => $dir,
+ pidbase => "$dir/subdir",
filename => $FILENAME,
);
isa_ok($app, 'FileMaker');
isa_ok($app->pidfile, 'MooseX::Daemonize::Pid::File');
-is($app->pidfile->file, catfile($dir, "filemaker.pid"), '... got the right PID file path');
+is($app->pidfile->file, catfile("$dir/subdir", "filemaker.pid"), '... got the right PID file path');
ok(not(-e $app->pidfile->file), '... our pidfile does not exist');
ok(!$app->status, '... the daemon is running');
if (DEBUG) {
diag `ps $pid`;
- diag "Status is: " . $app->status_message;
+ diag "Status is: " . $app->status_message;
}
ok( -e $app->filename, "file exists" );
if (DEBUG) {
diag `ps $pid`;
- diag "Status is: " . $app->status_message;
+ diag "Status is: " . $app->status_message;
}
ok( $app->stop, '... app stopped' );
if (DEBUG) {
diag `ps $pid`;
- diag "Status is: " . $app->status_message;
+ diag "Status is: " . $app->status_message;
}
ok( not(-e $app->pidfile->file) , '... pidfile gone' );