diff --git a/cronie-nofork-nopid.patch b/cronie-nofork-nopid.patch new file mode 100644 index 0000000..9a24d5d --- /dev/null +++ b/cronie-nofork-nopid.patch @@ -0,0 +1,22 @@ +--- src/misc.c.orig ++++ src/misc.c +@@ -293,6 +293,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. */ +--- src/cron.c.orig ++++ src/cron.c +@@ -600,7 +600,7 @@ static void sigchld_handler(int x) { + } + + static void quit(int x) { +- (void) unlink(_PATH_CRON_PID); ++ if(NoFork == 0) unlink(_PATH_CRON_PID); + _exit(0); + } + diff --git a/cronie.changes b/cronie.changes index 1c2f6b1..7a6785e 100644 --- a/cronie.changes +++ b/cronie.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Aug 15 00:48:54 UTC 2012 - crrodriguez@opensuse.org + +- 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. + ------------------------------------------------------------------- Mon Jun 25 10:38:29 UTC 2012 - coolo@suse.com diff --git a/cronie.spec b/cronie.spec index de32f25..87cbf7b 100644 --- a/cronie.spec +++ b/cronie.spec @@ -57,6 +57,7 @@ Patch7: cronie-1.4.7-disable_logging.patch # PATCH-FIX-UPSTREAM use run-crons instead of run-parts for anacron (bnc#689494) Patch8: cronie-anacron-1.4.7-run-crons.patch Patch9: cronie-1.4.8-bug_756197.diff +Patch10: cronie-nofork-nopid.patch Conflicts: cron <= 4.1 # When finish update protection of sles11 we could uncomment line bellow and drop all # ugly hacks with subpackage cron needed for proper update proces @@ -101,7 +102,7 @@ overloaded in settings. %patch8 -p1 %patch9 cp %{S:7} ./cron_to_cronie.README - +%patch10 %build # fill macro CRON_VERSION it is used in top three lines of crontab file,should be reworked export CFLAGS="$RPM_OPT_FLAGS -DCRON_VERSION=\\\"%{version}\\\""