Skip to content

Commit

Permalink
done with docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bobrik committed Oct 4, 2011
1 parent e248bbb commit 93135aa
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions README.markdown
Expand Up @@ -59,13 +59,8 @@ some sort of stringifiable error object. Defaults to init.startFailed.

### init.stop(pidfile, cb, killer)

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.
Stops your service with one of shutdown functions. Default is
`init.hardKiller(2000)`, but you may pass your own.

### init.status(pidfile, cb)

Expand All @@ -92,6 +87,26 @@ A string on which to dispatch. Defaults to your program's first argument
(process.argv[2]). Recognized actions are "start", "stop", "restart",
"try-restart", "force-reload", and "status".

#### killer
As in init.stop()

Shutdown functions
-----------------

### init.hardKiller(delay = 2000)

Sends your service TERM, INT, QUIT, in that order (with 2000 ms 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.
This is default shutdown function.

### init.softKiller(delay = 2000)

Sends your service TERM and wait until it die with 2000 ms delays. This is
preferred choice for graceful shutdown. Your service may decide when it want
to stop with no data loss.


Default Actions
---------------
These functions are the defaults for various callbacks, but you can call them
Expand Down

0 comments on commit 93135aa

Please sign in to comment.