[syslog-ng] [PATCH 3/3] mainloop: Add support for clearing the status

Gergely Nagy algernon at balabit.hu
Tue Apr 9 13:03:23 CEST 2013


This introduces a new function, main_loop_clear_status(), that will
clear the status when running with systemd support enabled. It also
changes the code that under normal conditions, no status is shown.

Signed-off-by: Gergely Nagy <algernon at balabit.hu>
---
 lib/mainloop.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lib/mainloop.c b/lib/mainloop.c
index 91b37e4..6f59756 100644
--- a/lib/mainloop.c
+++ b/lib/mainloop.c
@@ -484,6 +484,12 @@ main_loop_publish_status(const gchar *status)
 }
 
 static void
+main_loop_clear_status(void)
+{
+  sd_notify(0, "STATUS=");
+}
+
+static void
 main_loop_indicate_readiness(void)
 {
   sd_notify(0, "READY=1");
@@ -492,6 +498,7 @@ main_loop_indicate_readiness(void)
 #else
 
 #define main_loop_publish_status(x)
+#define main_loop_clear_status()
 #define main_loop_indicate_readiness()
 
 #endif
@@ -539,7 +546,7 @@ main_loop_reload_config_apply(void)
       main_loop_new_config->persist = NULL;
       cfg_free(main_loop_old_config);
       current_configuration = main_loop_new_config;
-      main_loop_publish_status("Running");
+      main_loop_clear_status();
     }
   else
     {
@@ -776,7 +783,7 @@ main_loop_run(void)
 
   /* main loop */
   main_loop_indicate_readiness();
-  main_loop_publish_status("Running...");
+  main_loop_clear_status();
   iv_main();
   main_loop_publish_status("Shutting down...");
 
-- 
1.7.10.4




More information about the syslog-ng mailing list