chiark / gitweb /
hashmap: hashmap_move_one() should return -ENOENT when 'other' is NULL
[elogind.git] / src / journal / journald.c
index c8c0801fafe0e7f4fd2a00a57b63e3437b2a395e..de40827d6aac109f524576e6cc42e1ba7b28193f 100644 (file)
@@ -24,9 +24,9 @@
 #include <errno.h>
 #include <unistd.h>
 
-#include <systemd/sd-journal.h>
-#include <systemd/sd-messages.h>
-#include <systemd/sd-daemon.h>
+#include "systemd/sd-journal.h"
+#include "systemd/sd-messages.h"
+#include "systemd/sd-daemon.h"
 
 #include "journal-authenticate.h"
 #include "journald-server.h"
@@ -37,11 +37,6 @@ int main(int argc, char *argv[]) {
         Server server;
         int r;
 
-        /* if (getppid() != 1) { */
-        /*         log_error("This program should be invoked by init only."); */
-        /*         return EXIT_FAILURE; */
-        /* } */
-
         if (argc > 1) {
                 log_error("This program does not take arguments.");
                 return EXIT_FAILURE;
@@ -62,7 +57,7 @@ int main(int argc, char *argv[]) {
         server_flush_to_var(&server);
         server_flush_dev_kmsg(&server);
 
-        log_debug("systemd-journald running as pid %lu", (unsigned long) getpid());
+        log_debug("systemd-journald running as pid "PID_FMT, getpid());
         server_driver_message(&server, SD_MESSAGE_JOURNAL_START, "Journal started");
 
         sd_notify(false,
@@ -70,7 +65,7 @@ int main(int argc, char *argv[]) {
                   "STATUS=Processing requests...");
 
         for (;;) {
-                usec_t t = (usec_t) -1, n;
+                usec_t t = USEC_INFINITY, n;
 
                 r = sd_event_get_state(server.event);
                 if (r < 0)
@@ -117,11 +112,13 @@ int main(int argc, char *argv[]) {
                 server_maybe_warn_forward_syslog_missed(&server);
         }
 
-        log_debug("systemd-journald stopped as pid %lu", (unsigned long) getpid());
+        log_debug("systemd-journald stopped as pid "PID_FMT, getpid());
         server_driver_message(&server, SD_MESSAGE_JOURNAL_STOP, "Journal stopped");
 
 finish:
-        sd_notify(false, "STATUS=Shutting down...");
+        sd_notify(false,
+                  "STOPPING=1\n"
+                  "STATUS=Shutting down...");
 
         server_done(&server);