diff --git a/README.markdown b/README.markdown index 7a1e9da..ab0115a 100644 --- a/README.markdown +++ b/README.markdown @@ -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) @@ -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