mkpidfile
v1.0.1
Published
Helper module for creating, locking, writing and closing proper mkpidfiles.
Downloads
173
Readme
mkpidfile
Copyright (c) 2017 Michael Welter [email protected]
About
Helper module for creating, locking, writing and closing proper pidfiles. I use for monit based monitoring of my Node servers.
The pidfile created will be unlinked when exiting if process.on("exit") is emitted.
Install
$ npm install --save mkpidfile
Usage
// Setup signal handlers so process exit event can be triggered
[ "SIGINT", "SIGTERM" ].forEach(signal => process.on(signal, process.exit));
require("mkpidfile")("/var/run/example.pid");
Debugging
NODE_DEBUG=mkpidfile