uses forever-monitor to run and interact with a process running index.js.
lib/log.js:
logging functionality for service.js, both to stdout/stderr and to files.
Why forever-monitor and not forever?
The reason we want either of these is to have a "master" kind of process that interacts with and keeps an eye on the application process. What we don't need is another arbitrary process manager (the "actual" process manager, sysvinit/upstart/systemd, can do that fine).
forever-monitor is only the "master process" part of forever, it turned out to be easy to integrate and when integrated it's easy to hook into (e.g. for restarting, stopping and/or logging kinds of things). forever would not really be integrated in the application (it's normally even installed and configured globally), and it would add a layer of process management we're not looking for.
Most important changes:
forever
,forever-monitor
.service.js
instead ofindex.js
.forever-monitor
to run and interact with a process runningindex.js
.service.js
, both to stdout/stderr and to files.Why
forever-monitor
and notforever
? The reason we want either of these is to have a "master" kind of process that interacts with and keeps an eye on the application process. What we don't need is another arbitrary process manager (the "actual" process manager, sysvinit/upstart/systemd, can do that fine).forever-monitor
is only the "master process" part offorever
, it turned out to be easy to integrate and when integrated it's easy to hook into (e.g. for restarting, stopping and/or logging kinds of things).forever
would not really be integrated in the application (it's normally even installed and configured globally), and it would add a layer of process management we're not looking for.