Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Detecting stale pid file under *nix

by andal (Hermit)
on Oct 25, 2016 at 07:20 UTC ( #1174648=note: print w/replies, xml ) Need Help??


in reply to Detecting stale pid file under *nix

If you are already checking the /proc/$pid, then why don't you check /proc/$pid/cmdline to see, if it contains name of your daemon? Or you can read destination of the symbolic link /proc/$pid/exe to see if it points to the executable of the daemon

If the daemon is your own application, then you may want to change it so that it listens for termination (or other commands) on some hidden unix socket. Then you can terminate it by writing to that socket.

  • Comment on Re: Detecting stale pid file under *nix

Replies are listed 'Best First'.
Re^2: Detecting stale pid file under *nix
by Dallaylaen (Chaplain) on Oct 25, 2016 at 13:30 UTC

    Daemon is really a PSGI application, so the exe is doing to point to Perl interpreter and modification of daemon itself is possible, but undesired. I'd rather complicate my init script...

      Then check command line. Even if it is perl, the command line still contains name of the script and parameters.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2022-01-18 16:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (53 votes). Check out past polls.

    Notices?