mkpidfile

1.0.1 • Public • Published

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

Dependents (0)

Package Sidebar

Install

npm i mkpidfile

Weekly Downloads

25

Version

1.0.1

License

MIT

Last publish

Collaborators

  • mikinho