From: Teemu Toivola Date: Thu, 18 Jul 2019 11:23:20 +0000 (+0300) Subject: allow vnstatd to fork() when --daemon is used even when started by PID 1 X-Git-Tag: v2.4~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9ca9706243f61f08b8b37f14e649e44eca1923e7;p=vnstat allow vnstatd to fork() when --daemon is used even when started by PID 1 --- diff --git a/CHANGES b/CHANGES index af31b5b..cdc7689 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,10 @@ +2.4 / + + - Fixed + - Daemon didn't fork() even when requested to with --daemon when started + by PID 1 (issue seen at least in Docker containers) + + 2.3 / 10-Jul-2019 - Fixed diff --git a/src/daemon.c b/src/daemon.c index 6de2ce8..572fe24 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -16,10 +16,6 @@ void daemonize(void) int i; char str[10]; - if (getppid() == 1) { - return; /* already a daemon */ - } - i = (int)fork(); if (i < 0) { /* fork error */