write pid after daemonize()

This commit is contained in:
Axel Kittenberger 2011-01-12 15:48:50 +00:00
parent e4d815b770
commit 50c133ff73
1 changed files with 3 additions and 3 deletions

View File

@ -1120,9 +1120,6 @@ l_configure(lua_State *L)
* from this on log to configurated log end instead of
* stdout/stderr */
running = true;
if (settings.pidfile) {
write_pidfile(L, settings.pidfile);
}
if (!settings.nodaemon && !is_daemon) {
if (!settings.log_file) {
settings.log_syslog = true;
@ -1130,6 +1127,9 @@ l_configure(lua_State *L)
logstring("Debug", "daemonizing now.");
daemonize(L);
}
if (settings.pidfile) {
write_pidfile(L, settings.pidfile);
}
} else if (!strcmp(command, "nodaemon")) {
settings.nodaemon = true;
} else if (!strcmp(command, "logfile")) {