diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-04-24 14:28:00 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-04-24 14:42:24 +0200 |
commit | f2b6878955b1f77ea1fa87b502b13d5dbefc57f6 (patch) | |
tree | 3fdf72d167a9e64ac16aaac52eaffa57c3cb9d13 /src/core/service.c | |
parent | 8d8e945624a0080073d94941f3032b8fa3b3aa15 (diff) |
service: introduce Type=idle and use it for gettys
Type=idle is much like Type=simple, however between the fork() and the
exec() in the child we wait until PID 1 informs us that no jobs are
left.
This is mostly a cosmetic fix to make gettys appear only after all boot
output is finished and complete.
Note that this does not impact the normal job logic as we do not delay
the completion of any jobs. We just delay the invocation of the actual
binary, and only for services that otherwise would be of Type=simple.
Diffstat (limited to 'src/core/service.c')
-rw-r--r-- | src/core/service.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/service.c b/src/core/service.c index 59dd71294b..4358a948de 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -1769,6 +1769,7 @@ static int service_spawn( UNIT(s)->cgroup_bondings, UNIT(s)->cgroup_attributes, is_control ? "control" : NULL, + s->type == SERVICE_IDLE ? UNIT(s)->manager->idle_pipe : NULL, &pid); if (r < 0) @@ -2130,7 +2131,7 @@ static void service_enter_start(Service *s) { if (r < 0) goto fail; - if (s->type == SERVICE_SIMPLE) { + if (s->type == SERVICE_SIMPLE || s->type == SERVICE_IDLE) { /* For simple services we immediately start * the START_POST binaries. */ @@ -3714,7 +3715,8 @@ static const char* const service_type_table[_SERVICE_TYPE_MAX] = { [SERVICE_FORKING] = "forking", [SERVICE_ONESHOT] = "oneshot", [SERVICE_DBUS] = "dbus", - [SERVICE_NOTIFY] = "notify" + [SERVICE_NOTIFY] = "notify", + [SERVICE_IDLE] = "idle" }; DEFINE_STRING_TABLE_LOOKUP(service_type, ServiceType); |