Hello.
Sorry, my English is poor.
I tried install Daemon::Daemonize 0.003, and errors occurred at 'make test'.
----------------------------
t/01-daemonize.t ........................ t/01-daemonize.t
........................ 1/?
# Failed test at t/01-daemonize.t line 30.
# Failed test at t/01-daemonize.t line 31.
# pid is 0
# Looks like you failed 2 tests of 3.
t/01-daemonize.t
........................ Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/3 subtests
t/02-daemonize-stdout-stderr.t .......... t/02-daemonize-stdout-stderr.t
.......... 1/?
# Failed test at t/02-daemonize-stdout-stderr.t line 36.
# Failed test at t/02-daemonize-stdout-stderr.t line 37.
# pid is 0
Can't read /tmp/TZZ50txEjQ/stdout: No such file or directory at
/usr/local/lib/perl5/site_perl/5.8.8/Path/Class/File.pm line 60.
# Looks like you failed 2 tests of 3.
# Looks like your test exited with 2 just after 3.
t/02-daemonize-stdout-stderr.t .......... Dubious, test returned 2
(wstat 512, 0x200)
Failed 2/3 subtests
t/03-daemonize-stdout-stderr-via-env.t ..
t/03-daemonize-stdout-stderr-via-env.t .. 1/?
# Failed test at t/03-daemonize-stdout-stderr-via-env.t line 34.
# Failed test at t/03-daemonize-stdout-stderr-via-env.t line 35.
# pid is 0
Can't read /tmp/JXXkHrER6R/stdout: No such file or directory at
/usr/local/lib/perl5/site_perl/5.8.8/Path/Class/File.pm line 60.
# Looks like you failed 2 tests of 3.
# Looks like your test exited with 2 just after 3.
t/03-daemonize-stdout-stderr-via-env.t .. Dubious, test returned 2
(wstat 512, 0x200)
Failed 2/3 subtests
t/04-read-write-delete-check-pidfile.t ..
t/04-read-write-delete-check-pidfile.t .. 1/?
# Failed test at t/04-read-write-delete-check-pidfile.t line 31.
# Failed test at t/04-read-write-delete-check-pidfile.t line 32.
# Failed test at t/04-read-write-delete-check-pidfile.t line 33.
# pid is 0 is 0
# Failed test at t/04-read-write-delete-check-pidfile.t line 37.
# got: undef
# expected: '0'
# Failed test at t/04-read-write-delete-check-pidfile.t line 38.
# got: undef
# expected: '0'
make: *** [test_dynamic] Interrupt
----------------------------
Perl 5.8.8
CentOS 4.4
I tried following.
1)
Error message: 'No such file or directory', 'pid is 0'
I inserted a line in to 01-daemonize.t.
Daemon::Daemonize->write_pidfile( $shb_file );
`ls -l $tmpdir > /tmp/tmp001`; # Inserted line
I checked /tmp/tmp001, $tmpdir is empty.
2)
I checked return value of daemonize().
my $rtn = Daemon::Daemonize->daemonize ( run => sub {
...
diag( "rtn is $rtn" );
That looks like undef.
3)
I wrote short script that specify output STDERR to a file, and I ran this.
Then, error occurred.
Can't use string ("0") as a symbol ref while "strict refs" in use at
/path/to/Daemonize.pm line 212.
Line 212:
open( NULL, '/dev/null' );
I do not understand the meaning of this open(). But, I think that 'NULL'
is a bareword, and it was evaluated for a zero.
I try edit Daemonize.pm.
# open( NULL, '/dev/null' );
# <NULL> if 0;
local *NULLFH;
open( NULLFH, '/dev/null' );
<NULLFH> if 0;
Then, all tests successful, and install completed.
Is my solution right?
What is the meaning of 'open( NULL ...' and reading?