X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fcore%2Fservice.c;h=ec6aaa55c59a29d966eea07b39d55f02dd1af8ca;hp=936fee2636320f98705d1d42e1fa34698c228186;hb=d081dffbd3e57dc9da494a3384e333bf565d4175;hpb=e056b01d8acea7fc06d52ef91d227d744faf5259 diff --git a/src/core/service.c b/src/core/service.c index 936fee263..ec6aaa55c 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -928,10 +928,6 @@ static int service_load_sysv_path(Service *s, const char *path) { s->guess_main_pid = false; s->restart = SERVICE_RESTART_NO; s->exec_context.ignore_sigpipe = false; - - if (UNIT(s)->manager->sysv_console) - s->exec_context.std_output = EXEC_OUTPUT_JOURNAL_AND_CONSOLE; - s->exec_context.kill_mode = KILL_PROCESS; /* We use the long description only if @@ -1249,6 +1245,10 @@ static int service_load(Unit *u) { if (s->type == _SERVICE_TYPE_INVALID) s->type = s->bus_name ? SERVICE_DBUS : SERVICE_SIMPLE; + /* Oneshot services have disabled timeout by default */ + if (s->type == SERVICE_ONESHOT && !s->timeout_defined) + s->timeout_usec = 0; + service_fix_output(s); if ((r = unit_add_exec_dependencies(u, &s->exec_context)) < 0) @@ -1806,6 +1806,7 @@ static int service_spawn( UNIT(s)->cgroup_bondings, UNIT(s)->cgroup_attributes, is_control ? "control" : NULL, + UNIT(s)->id, s->type == SERVICE_IDLE ? UNIT(s)->manager->idle_pipe : NULL, &pid); @@ -2157,7 +2158,7 @@ static void service_enter_start(Service *s) { r = service_spawn(s, c, - s->type == SERVICE_FORKING || s->type == SERVICE_DBUS || s->type == SERVICE_NOTIFY, + s->type == SERVICE_FORKING || s->type == SERVICE_DBUS || s->type == SERVICE_NOTIFY || s->type == SERVICE_ONESHOT, true, true, true, @@ -2372,7 +2373,7 @@ static void service_run_next_main(Service *s) { r = service_spawn(s, s->main_command, - false, + true, true, true, true,