cronie/cronie-nofork-nopid.patch
Andreas Jaeger a4cb10500c 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
2012-08-26 08:00:29 +00:00

23 lines
498 B
Diff

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