From: Kristýna Streitová Date: Wed, 29 Mar 2017 10:15:31 +0000 (+0200) Subject: Avoid creating pid files when crond doesn't fork X-Git-Tag: cronie-1.5.2~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5b285b46b88dc63689c6a56542cb2ba81f861b66;p=cronie Avoid creating pid files when crond doesn't fork When the cron daemon does not fork, as it is the case when using systemd, pid files are useless. Avoid creating them in the first place. This change originally comes from cronie-nofork-nopid.patch added to openSUSE by Cristian Rodríguez (crrodriguez@opensuse.org). --- diff --git a/src/misc.c b/src/misc.c index 10b6fd6..01df75a 100644 --- a/src/misc.c +++ b/src/misc.c @@ -315,6 +315,8 @@ void acquire_daemonlock(int closeflag) { return; } + if(NoFork == 1) return; //move along, nothing to do here... + if (fd == -1) { pidfile = _PATH_CRON_PID; /* Initial mode is 0600 to prevent flock() race/DoS. */