Don't use pidfile if we're in foreground mode

This commit is contained in:
Joris Vink 2014-07-31 14:02:33 +02:00
parent a664e2a655
commit ef49a0d4e1
1 changed files with 5 additions and 2 deletions

View File

@ -134,7 +134,9 @@ main(int argc, char *argv[])
kore_log(LOG_NOTICE, "server shutting down");
kore_worker_shutdown();
unlink(kore_pidfile);
if (!foreground)
unlink(kore_pidfile);
LIST_FOREACH(l, &listeners, list)
close(l->fd);
@ -273,7 +275,8 @@ kore_server_start(void)
fatal("cannot daemon(): %s", errno_s);
kore_pid = getpid();
kore_write_kore_pid();
if (!foreground)
kore_write_kore_pid();
kore_log(LOG_NOTICE, "kore is starting up");
#if defined(KORE_USE_PGSQL)