diff --git a/cronie-1.5.4-always_create_pid_file.patch b/cronie-1.5.4-always_create_pid_file.patch new file mode 100644 index 0000000..5531566 --- /dev/null +++ b/cronie-1.5.4-always_create_pid_file.patch @@ -0,0 +1,26 @@ +From 0570c2cd979bc9ce1da6a873089e89dbca900a1f Mon Sep 17 00:00:00 2001 +From: Tomas Mraz +Date: Tue, 7 May 2019 14:45:53 +0200 +Subject: [PATCH] Revert "Avoid creating pid files when crond doesn't fork" + +This reverts commit 5b285b46b88dc63689c6a56542cb2ba81f861b66. +The PID file is useful to avoid running multiple crond instances +at once. +--- + src/misc.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/src/misc.c b/src/misc.c +index 42153b8..faf6ffb 100644 +--- a/src/misc.c ++++ b/src/misc.c +@@ -315,9 +315,6 @@ 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. */ diff --git a/cronie.changes b/cronie.changes index c497006..4e4fbb0 100644 --- a/cronie.changes +++ b/cronie.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu May 16 10:16:10 UTC 2019 - Kristýna Streitová + +- add cronie-1.5.4-always_create_pid_file.patch to always create + a pid file even when the cron daemon does not fork. The PID file + is useful to avoid running multiple "cron -n" instances at once + [bsc#1133100] + ------------------------------------------------------------------- Fri Mar 29 13:50:01 UTC 2019 - Kristýna Streitová diff --git a/cronie.spec b/cronie.spec index 25339d2..91575c8 100644 --- a/cronie.spec +++ b/cronie.spec @@ -52,6 +52,7 @@ Patch12: cronie-piddir.patch # in manpage file because the /etc/crontab is still used in SUSE. Patch13: fix-manpage-replace-anacrontab-with-crontab.patch Patch14: cronie-1.5.4-dont_abort_loading_crontab.patch +Patch15: cronie-1.5.4-always_create_pid_file.patch BuildRequires: audit-devel BuildRequires: autoconf BuildRequires: automake @@ -112,6 +113,7 @@ cp %{SOURCE7} ./cron_to_cronie.README %patch12 -p1 %patch13 -p1 %patch14 -p1 +%patch15 -p1 %build # fill macro CRON_VERSION it is used in top three lines of crontab file,should be reworked