chiark / gitweb /
service: by default send service output to syslog, except for SysV services which...
authorLennart Poettering <lennart@poettering.net>
Wed, 19 May 2010 02:28:25 +0000 (04:28 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 19 May 2010 02:28:25 +0000 (04:28 +0200)
src/execute.c
src/service.c

index 107683470244a5ae1b8e90e938b5c783ef7ef3e1..37b2f8412c87af5ec18c2553941e874325ce87b5 100644 (file)
@@ -1087,6 +1087,10 @@ void exec_context_init(ExecContext *c) {
         c->cpu_sched_policy = SCHED_OTHER;
         c->syslog_priority = LOG_DAEMON|LOG_INFO;
         c->mount_flags = MS_SHARED;
+
+        c->std_input = EXEC_INPUT_NULL;
+        c->std_output = EXEC_OUTPUT_SYSLOG;
+        c->std_error = EXEC_OUTPUT_SYSLOG;
 }
 
 void exec_context_done(ExecContext *c) {
index 2515cd305f2e7686a78b54daf329cb9572a9bdd3..0615b51490a4235b716839ed24cce8c02745c1e2 100644 (file)
@@ -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;