chiark / gitweb /
execute: talk directly to the journald, instead to the stdout-syslog-bridge
[elogind.git] / src / unit.c
index 03c90f5874908335b448f398e04b6d5e79339403..b31b92fc24ebb054ae1f898f097aec81e2821db2 100644 (file)
@@ -573,7 +573,7 @@ int unit_add_exec_dependencies(Unit *u, ExecContext *c) {
          * logging daemon is run first. */
 
         if (u->meta.manager->running_as == MANAGER_SYSTEM)
-                if ((r = unit_add_two_dependencies_by_name(u, UNIT_REQUIRES, UNIT_AFTER, SPECIAL_STDOUT_SYSLOG_BRIDGE_SOCKET, NULL, true)) < 0)
+                if ((r = unit_add_two_dependencies_by_name(u, UNIT_REQUIRES, UNIT_AFTER, SPECIAL_JOURNALD_SOCKET, NULL, true)) < 0)
                         return r;
 
         return 0;
@@ -2441,9 +2441,6 @@ int unit_coldplug(Unit *u) {
 
 void unit_status_printf(Unit *u, const char *status, const char *format, ...) {
         va_list ap;
-        char *s, *e;
-        int err;
-        const unsigned emax = status ? 80 - (sizeof("[  OK  ]")-1) : 80;
 
         assert(u);
         assert(format);
@@ -2458,21 +2455,8 @@ void unit_status_printf(Unit *u, const char *status, const char *format, ...) {
                 return;
 
         va_start(ap, format);
-        err = vasprintf(&s, format, ap);
+        status_vprintf(status, true, format, ap);
         va_end(ap);
-        if (err < 0)
-                return;
-
-        e = ellipsize(s, emax, 100);
-        free(s);
-        if (!e)
-                return;
-
-        if (status)
-                status_printf("%s%*s[%s]\n", e, emax - strlen(e), "", status);
-        else
-                status_printf("%s\n", e);
-        free(e);
 }
 
 bool unit_need_daemon_reload(Unit *u) {