daemon

Boilerplate code to start linux daemon. Other platforms will fallback to terminal mode.

Members

Functions

runDaemon
int runDaemon(ILogger logger, int delegate(string[]) progMain, string[] args, void delegate() listener, void delegate() termListener, void delegate() rotateListener, string pidfile, string lockfile, int groupid, int userid)

Forks daemon process with progMain main function and passes args to it. If daemon catches SIGHUP signal, listener delegate is called. If daemon catches SIGQUIT, SIGABRT, or any other terminating sygnal, the termListener is called.

See Also

terminal

Meta

License

Subject to the terms of the MIT license, as written in the included LICENSE file.

Authors

NCrashed <ncrashed@gmail.com>