xtpu2 has asked for the wisdom of the Perl Monks concerning the following question:
I'm experiencing a very strange error (strange for my limited experience, anyway) with Proc::Daemon.
I have a perl daemon that fails with the error message:
Can't call method "isa" on unblessed reference at /usr/local/share/perl/5.14.2/Proc/Daemon.pm line 88, <STDIN> line 3.The line 88 in question from Proc::Daemon is this one:
unless ( ref( $self ) && eval{ $self->isa( 'Proc::Daemon' ) } ) {It is located in the "Init" subroutine in Proc::Daemon.
The reason that I'm calling this error "bizarre" is because a) Why is the script dying when executing an expression in an eval? Isn't that the whole point of eval? b) This script was working not 2 weeks ago when I was testing it on this same system. During that time there have not been any updates to the Proc::Daemon module or to Perl.
Here is the code that calls Proc::Daemon:
Proc::Daemon::Init({ work_dir => '/tmp', setuid => 'some_uid' });
I do have a custom DIE signal handler (which I thought might be the cause of the error, but if so, I must not understand something about the way evals work). It looks like this:
$SIG{'__DIE__'} = sub{ write_to_log('FATAL! '.join(' ', @_)); die; };
Can anybody shed some light on this thing?
Edited to Add: Further poking around has narrowed the problem down to the setuid parameter for Proc::Daemon::Init. If I remove it, the script runs fine. However, this means the script is running as root and I would like to avoid that. Investigatining further...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Bizarre Proc::Daemon error # die-handler
by LanX (Saint) on Jun 10, 2014 at 03:09 UTC | |
by hv (Prior) on Jun 12, 2014 at 08:41 UTC | |
by LanX (Saint) on Jun 12, 2014 at 12:12 UTC | |
|
Re: Bizarre Proc::Daemon error
by parv (Parson) on Jun 09, 2014 at 22:27 UTC | |
by LanX (Saint) on Jun 10, 2014 at 02:53 UTC | |
by parv (Parson) on Jun 11, 2014 at 23:46 UTC | |
by xtpu2 (Acolyte) on Jun 10, 2014 at 01:39 UTC | |
by Anonymous Monk on Jun 10, 2014 at 10:57 UTC |