totallymike / ircnode

Extensible IRC bot written with node.js
https://github.com/totallymike/ircnode/wiki
MIT License
4 stars 2 forks source link

Automatically delete outdated ircnode.pid files #48

Closed sigv closed 11 years ago

sigv commented 12 years ago

Currently, when the bot gets killed for any reason (machine going down or just an uncaught exception), the daemon ircnode.pid file still resides at it's set location. Afterwards, the bot cannot be launched unless the pid file is deleted. The ircnode start will fail with a message about a pid file already existing and ircnode restart will fail at killing the old process.

The bot should automatically detect if a node process is already running with the pid specified in the ircnode.pid file. If that is not true, then it should delete the ircnode.pid file quietly.