X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fservice.c;h=eeabe8fb01ec83b22ee653479360f1be95d39d3e;hb=62bca2c657bf95fd1f69935eef09915afa5c69d9;hp=936fee2636320f98705d1d42e1fa34698c228186;hpb=e056b01d8acea7fc06d52ef91d227d744faf5259;p=elogind.git diff --git a/src/core/service.c b/src/core/service.c index 936fee263..eeabe8fb0 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -1249,6 +1249,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 +1810,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 +2162,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 +2377,7 @@ static void service_run_next_main(Service *s) { r = service_spawn(s, s->main_command, - false, + true, true, true, true,