chiark / gitweb /
execute: talk directly to the journald, instead to the stdout-syslog-bridge
[elogind.git] / src / service.c
index 07137d265d3fab1b05c5ebac5b9601da8fc4c0f7..feecbbe2b6a93ad919e8bf32aec71f2069aefe25 100644 (file)
@@ -841,7 +841,7 @@ static int service_load_sysv_path(Service *s, const char *path) {
         s->restart = SERVICE_RESTART_NO;
 
         if (s->meta.manager->sysv_console)
-                s->exec_context.std_output = EXEC_OUTPUT_TTY;
+                s->exec_context.std_output = EXEC_OUTPUT_SYSLOG_AND_CONSOLE;
 
         s->exec_context.kill_mode = KILL_PROCESS;
 
@@ -2870,20 +2870,22 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
                                 break;
 
                         case SERVICE_START_POST:
-                                if (success) {
-                                        if (s->pid_file) {
-                                                int r = service_load_pid_file(s, true);
-                                                if (r < 0) {
-                                                        r = service_demand_pid_file(s);
-                                                        if (r < 0 || !cgroup_good(s))
-                                                                service_enter_stop(s, false);
-                                                        break;
-                                                }
-                                        } else
-                                                service_search_main_pid(s);
+                                if (!success) {
+                                        service_enter_stop(s, false);
+                                        break;
                                 }
 
-                                s->reload_failure = !success;
+                                if (s->pid_file) {
+                                        int r = service_load_pid_file(s, true);
+                                        if (r < 0) {
+                                                r = service_demand_pid_file(s);
+                                                if (r < 0 || !cgroup_good(s))
+                                                        service_enter_stop(s, false);
+                                                break;
+                                        }
+                                } else
+                                        service_search_main_pid(s);
+
                                 service_enter_running(s, true);
                                 break;