summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorCristian Rodríguez <crrodriguez@opensuse.org>2013-06-14 00:40:48 -0400
committerRainer Gerhards <rgerhards@adiscon.com>2013-06-14 07:49:11 +0200
commitb31838624119708b3d265dd34d6bc6cda25944c8 (patch)
tree329b6b657dc0fa0706aee39a251cc689cd581473 /tools
parentd7da379009f7cabbfa0e9577fbdbff5d846dfd95 (diff)
downloadrsyslog-b31838624119708b3d265dd34d6bc6cda25944c8.tar.gz
rsyslog-b31838624119708b3d265dd34d6bc6cda25944c8.tar.bz2
rsyslog-b31838624119708b3d265dd34d6bc6cda25944c8.zip
systemd: use service type notify
There is a time window, between rsyslog reporting syntax errors and the daemon returning with failure, this may cause systemctl restart rsyslog to not report any error inmediately but later in the logs which is confusing to users. The appropiate steps to correct this annoyance is to notify systemd with a simple sd_notify(0, "READY=1"); just before entering the main loop. Tested in openSUSE 12.3/13.1 x86_64
Diffstat (limited to 'tools')
-rw-r--r--tools/syslogd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 7a8e21c2..a8a733d6 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -2033,6 +2033,8 @@ int realMain(int argc, char **argv)
ourConf->globals.bErrMsgToStderr = 0;
}
+ sd_notify(0, "READY=1");
+
mainloop();
/* do any de-init's that need to be done AFTER this comment */