Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'better-shutdown' of github.com:bobrik/node-init into be…

…tter-shutdown
  • Loading branch information...
commit e248bbb9d0b523d00648991b2c76c3b4db007983 2 parents 739cf53 + 229f6fa
@bobrik bobrik authored
Showing with 11 additions and 4 deletions.
  1. +11 −4 README.markdown
View
15 README.markdown
@@ -57,11 +57,15 @@ about to daemonize). 'pid' will be the id of the running process, and
A function to be called if the start action cannot be performed. Error will be
some sort of stringifiable error object. Defaults to init.startFailed.
-### init.stop(pidfile, cb)
+### init.stop(pidfile, cb, killer)
-Sends your service TERM, INT, QUIT, in that order (with 2 second delays) and
-then KILL until the process is no longer running, then calls cb (defaults to
-init.stopped). If the process was running, cb's first argument will be true.
+If you omit `killer`, it sends your service TERM, INT, QUIT, in that order
+(with 2 second delays) and then KILL until the process is no longer running,
+then calls cb (defaults to init.stopped). If the process was running,
+cb's first argument will be true. It is identical to pass `init.hardKiller(2000)`
+as killer argument. If you want to send SIGTERM signals to your process and
+wait until it die, use `init.softKiller(delay = 2000)` to check for your pid
+every `delay` seconds while it's alive. Then `cb` will be called.
### init.status(pidfile, cb)
@@ -80,6 +84,9 @@ following keyword arguments:
#### logfile
As in init.start()
+### killer
+As in init.stop()
+
#### command
A string on which to dispatch. Defaults to your program's first argument
(process.argv[2]). Recognized actions are "start", "stop", "restart",
Please sign in to comment.
Something went wrong with that request. Please try again.