mirror of
https://github.com/octoleo/lsyncd.git
synced 2024-12-13 14:43:09 +00:00
write pid after daemonize()
This commit is contained in:
parent
e4d815b770
commit
50c133ff73
6
lsyncd.c
6
lsyncd.c
@ -1120,9 +1120,6 @@ l_configure(lua_State *L)
|
|||||||
* from this on log to configurated log end instead of
|
* from this on log to configurated log end instead of
|
||||||
* stdout/stderr */
|
* stdout/stderr */
|
||||||
running = true;
|
running = true;
|
||||||
if (settings.pidfile) {
|
|
||||||
write_pidfile(L, settings.pidfile);
|
|
||||||
}
|
|
||||||
if (!settings.nodaemon && !is_daemon) {
|
if (!settings.nodaemon && !is_daemon) {
|
||||||
if (!settings.log_file) {
|
if (!settings.log_file) {
|
||||||
settings.log_syslog = true;
|
settings.log_syslog = true;
|
||||||
@ -1130,6 +1127,9 @@ l_configure(lua_State *L)
|
|||||||
logstring("Debug", "daemonizing now.");
|
logstring("Debug", "daemonizing now.");
|
||||||
daemonize(L);
|
daemonize(L);
|
||||||
}
|
}
|
||||||
|
if (settings.pidfile) {
|
||||||
|
write_pidfile(L, settings.pidfile);
|
||||||
|
}
|
||||||
} else if (!strcmp(command, "nodaemon")) {
|
} else if (!strcmp(command, "nodaemon")) {
|
||||||
settings.nodaemon = true;
|
settings.nodaemon = true;
|
||||||
} else if (!strcmp(command, "logfile")) {
|
} else if (!strcmp(command, "logfile")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user