1.0.1 • Published 7 years ago
mkpidfile v1.0.1
mkpidfile
Copyright (c) 2017 Michael Welter michael@yammm.com
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
1.0.1
7 years ago