Skip Menu |

This queue is for tickets about the Daemon-Daemonize CPAN distribution.

Report information
The Basics
Id: 51198
Status: resolved
Priority: 0/
Queue: Daemon-Daemonize

People
Owner: Nobody in particular
Requestors: m-uchino [...] yetipapa.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.003
Fixed in: (no value)



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?
On Sun Nov 08 00:18:19 2009, m-uchino@yetipapa.com wrote: Show quoted text
> 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?
Thank you for figuring this out! Show quoted text
> What is the meaning of 'open( NULL ...' and reading?
It is to prevent warnings on some newer perl. What version of perl are you using? Your fix will go out on the next release.
Thank you for reply. Yes, I do not use perl that is newer than perl 5.8.8 which I posted before. I did not yet study new perl, and I did not know about warnings and NULL in new perl. Daemon::Daemonize is very nice. This is best simple module that I looked for. This has only some necessary functions. And I knew that this would work as DAEMON very definitely by reading this source code to solve this installation problem. CPAN has a lot of DAEMON modules. However, there are a module with many functions that I do not need, or the module which do not reopen, etc... Daemon::Daemonize performs all the procedures for DAEMON which I know. Thank you for making this module.