Accepting request 130827 from home:elvigia:branches:Base:System

- 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.

OBS-URL: https://build.opensuse.org/request/show/130827
OBS-URL: https://build.opensuse.org/package/show/Base:System/cronie?expand=0&rev=104
This commit is contained in:
Andreas Jaeger 2012-08-26 08:00:29 +00:00 committed by Git OBS Bridge
parent f6a7a656fc
commit a4cb10500c
3 changed files with 31 additions and 1 deletions

22
cronie-nofork-nopid.patch Normal file
View File

@ -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);
}

View File

@ -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

View File

@ -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}\\\""