X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fdaemon%2Fcollectd.c;h=1b9c3747a629fb6027460a3d1e88cb379c96ec4b;hb=741e018fff531bfe914781489d9b2c7a002f2bc7;hp=309af1badfadacb642a59b34317fed261576bc68;hpb=36841c62f07f1694a451fa7b54497de663331914;p=collectd.git diff --git a/src/daemon/collectd.c b/src/daemon/collectd.c index 309af1ba..1b9c3747 100644 --- a/src/daemon/collectd.c +++ b/src/daemon/collectd.c @@ -414,6 +414,7 @@ static int pidfile_remove (void) } /* static int pidfile_remove (const char *file) */ #endif /* COLLECT_DAEMON */ +#ifdef KERNEL_LINUX int notify_upstart (void) { const char *upstart_job = getenv("UPSTART_JOB"); @@ -479,6 +480,7 @@ int notify_systemd (void) close(fd); return 1; } +#endif /* KERNEL_LINUX */ int main (int argc, char **argv) { @@ -598,9 +600,13 @@ int main (int argc, char **argv) /* * Only daemonize if we're not being supervised - * by upstart or systemd. + * by upstart or systemd (when using Linux). */ - if (daemonize && notify_upstart() == 0 && notify_systemd() == 0) + if (daemonize +#ifdef KERNEL_LINUX + && notify_upstart() == 0 && notify_systemd() == 0 +#endif + ) { if ((pid = fork ()) == -1) {