forked from pool/cronie
a4cb10500c
- 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
23 lines
498 B
Diff
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);
|
|
}
|
|
|