chiark / gitweb /
execute: simplify stdin/stderr/stdout fixup a little
[elogind.git] / src / service.c
index dbef725ce65645a0a29d2e2027f6020145a0ebf3..0615b51490a4235b716839ed24cce8c02745c1e2 100644 (file)
@@ -225,7 +225,7 @@ finish:
         return 1;
 }
 
-static int sysv_chkconfig_order(Service *s) {
+static int sysv_fix_order(Service *s) {
         Meta *other;
         int r;
 
@@ -632,6 +632,11 @@ static int service_load_sysv_path(Service *s, const char *path) {
         s->valid_no_process = true;
         s->kill_mode = KILL_PROCESS_GROUP;
 
+        /* For SysV services log output should go to the console */
+        s->exec_context.std_input = EXEC_INPUT_NULL;
+        s->exec_context.std_output = EXEC_OUTPUT_TTY;
+        s->exec_context.std_error = EXEC_OUTPUT_TTY;
+
         u->meta.load_state = UNIT_LOADED;
         r = 0;
 
@@ -789,7 +794,7 @@ static int service_load(Unit *u) {
                 if ((r = unit_add_default_cgroup(u)) < 0)
                         return r;
 
-                if ((r = sysv_chkconfig_order(s)) < 0)
+                if ((r = sysv_fix_order(s)) < 0)
                         return r;
 
                 if (s->bus_name) {