diff --git a/daemonize.nim b/daemonize.nim index a9fa969..7177399 100644 --- a/daemonize.nim +++ b/daemonize.nim @@ -63,6 +63,8 @@ template daemonize*(pidfile, si, so, se, cd: string,body: stmt): stmt {.immediat c_signal(SIGINT, onStop) c_signal(SIGTERM, onStop) + c_signal(SIGHUP, onStop) + c_signal(SIGQUIT, onStop) pid = getpid() writeFile(pidfile, $pid) @@ -76,5 +78,5 @@ when isMainModule: i.inc() echo i discard sleep(1) - daemonize("/tmp/daemonize.pid", "/dev/null", "/tmp/daemonize.out", "/tmp/daemonize.err"): + daemonize("/tmp/daemonize.pid", "/dev/null", "/tmp/daemonize.out", "/tmp/daemonize.err", "/"): main() diff --git a/daemonize.nimble b/daemonize.nimble index f13fd18..fdfb4ba 100644 --- a/daemonize.nimble +++ b/daemonize.nimble @@ -1,6 +1,6 @@ [Package] name = "daemonize" -version = "0.0.3" +version = "0.0.4" author = "Huy Doan" description = "This library makes your code run as a daemon process on Unix-like systems" license = "MIT"