chiark / gitweb /
notify: send STOPPING=1 from our daemons
[elogind.git] / src / journal-remote / journal-remote.c
index aa659d1bd4b7278c489db88615645f250cfd5f3c..1cc86aeaf3bf17a87e7da57357d1a70acf4d3ac2 100644 (file)
@@ -579,7 +579,6 @@ static int request_handler(
                         log_error("MHD_get_connection_info failed: cannot get remote fd");
                         return mhd_respond(connection, MHD_HTTP_INTERNAL_SERVER_ERROR,
                                            "Cannot check remote address");
-                        return code;
                 }
 
                 fd = ci->connect_fd;
@@ -1531,10 +1530,12 @@ int main(int argc, char **argv) {
                 }
         }
 
-        server_destroy(&s);
+        sd_notifyf(false,
+                   "STOPPING=1\n"
+                   "STATUS=Shutting down after writing %" PRIu64 " entries...", s.event_count);
         log_info("Finishing after writing %" PRIu64 " entries", s.event_count);
 
-        sd_notify(false, "STATUS=Shutting down...");
+        server_destroy(&s);
 
         free(arg_key);
         free(arg_cert);