summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-01-11 03:16:24 +0100
committerLennart Poettering <lennart@poettering.net>2012-01-11 03:16:24 +0100
commit731a676c206bb1b48e7f736ce9f5b730252d1601 (patch)
tree3b53b0f7ea96f2b7e0268e89aaf805e2e22025e3
parent3ebcdf8cd97026724fd773648d02bde12d718824 (diff)
systemd: reconnect to syslog as soon as the journal is fully up
-rw-r--r--src/logs-show.c1
-rw-r--r--src/manager.c38
-rw-r--r--src/special.h2
-rw-r--r--src/systemd/sd-journal.h2
4 files changed, 13 insertions, 30 deletions
diff --git a/src/logs-show.c b/src/logs-show.c
index cb18da2aa5..2fe205fea6 100644
--- a/src/logs-show.c
+++ b/src/logs-show.c
@@ -178,6 +178,7 @@ static int output_short(sd_journal *j, unsigned line, bool show_all, bool monoto
uint64_t x;
time_t t;
struct tm tm;
+
r = -ENOENT;
if (realtime)
diff --git a/src/manager.c b/src/manager.c
index dbcd630b05..54df7ebe5f 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -3129,36 +3129,20 @@ void manager_recheck_syslog(Manager *m) {
if (m->running_as != MANAGER_SYSTEM)
return;
- if ((u = manager_get_unit(m, SPECIAL_SYSLOG_SOCKET))) {
- SocketState state;
-
- state = SOCKET(u)->state;
-
- if (state != SOCKET_DEAD &&
- state != SOCKET_FAILED &&
- state != SOCKET_RUNNING) {
-
- /* Hmm, the socket is not set up, or is still
- * listening, let's better not try to use
- * it. Note that we have no problem if the
- * socket is completely down, since there
- * might be a foreign /dev/log socket around
- * and we want to make use of that.
- */
-
- log_close_syslog();
- return;
- }
+ u = manager_get_unit(m, SPECIAL_JOURNALD_SOCKET);
+ if (u && SOCKET(u)->state != SOCKET_RUNNING) {
+ log_close_syslog();
+ return;
}
- if ((u = manager_get_unit(m, SPECIAL_SYSLOG_TARGET)))
- if (TARGET(u)->state != TARGET_ACTIVE) {
- log_close_syslog();
- return;
- }
+ u = manager_get_unit(m, SPECIAL_JOURNALD_SERVICE);
+ if (u && SERVICE(u)->state != SERVICE_RUNNING) {
+ log_close_syslog();
+ return;
+ }
- /* Hmm, OK, so the socket is either fully up, or fully down,
- * and the target is up, then let's make use of the socket */
+ /* Hmm, OK, so the socket is fully up and the service is up
+ * too, then let's make use of the thing. */
log_open();
}
diff --git a/src/special.h b/src/special.h
index b90161c238..8185eaf60e 100644
--- a/src/special.h
+++ b/src/special.h
@@ -71,7 +71,7 @@
#define SPECIAL_DBUS_SERVICE "dbus.service"
#define SPECIAL_DBUS_SOCKET "dbus.socket"
#define SPECIAL_JOURNALD_SOCKET "systemd-journald.socket"
-#define SPECIAL_SYSLOG_SOCKET "syslog.socket"
+#define SPECIAL_JOURNALD_SERVICE "systemd-journald.service"
/* Magic init signals */
#define SPECIAL_KBREQUEST_TARGET "kbrequest.target"
diff --git a/src/systemd/sd-journal.h b/src/systemd/sd-journal.h
index d0cb950455..ebc63b7640 100644
--- a/src/systemd/sd-journal.h
+++ b/src/systemd/sd-journal.h
@@ -37,8 +37,6 @@
* - handle incomplete header
*
* - kann NTP nicht finden?
- * - in unit.c check ob syslog.socket wegen logging reconnect is kaputt
- *
*
* - local deserializer
* - http server