Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: My daemon will not restart

by tirwhan (Abbot)
on Feb 14, 2008 at 17:04 UTC ( [id://667972]=note: print w/replies, xml ) Need Help??


in reply to My daemon will not restart

Do you close the open socket in your sub release_the_pid_file()? (Not shown in the source you provide)(Update:Just noticed that this is a sub of Proc::PID_File)

You're not closing the open socket. The system may not yet have disassociated the open socket with your old process, and the new one will be unable to bind to it (you can't have two processes listening to the same TCP port). The subsequent die "Failed to restart daemon" will never be reached because it's after the exec.


All dogma is stupid.

Replies are listed 'Best First'.
Re^2: My daemon will not restart
by pc88mxer (Vicar) on Feb 14, 2008 at 17:54 UTC
    This is a good suggestion. If you add:

    $server = undef;
    right before (or in) the call to &restart_daemon, things might work for you (at least they did in a stripped down version of your code.)
      I have undefing $server, as well as explicitly undefing $server->{_sock}, but with no change in behaviour.

      -=( Graq )=-

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://667972]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2024-04-19 14:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found