X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fservice.c;h=2ce95f5a9f2016e38e619e4aeea405e02db6db15;hb=122c1c819803fe742d9dac8088ac717469f3240c;hp=d4b874d62432292361625c198e709349fa964550;hpb=6464aa0890dd21bf0b3e3acfc2b24a425b252c51;p=elogind.git diff --git a/src/service.c b/src/service.c index d4b874d62..2ce95f5a9 100644 --- a/src/service.c +++ b/src/service.c @@ -203,7 +203,7 @@ static int sysv_translate_facility(const char *name, char **_r) { /* Debian extensions */ "$mail-transport-agent", SPECIAL_MAIL_TRANSFER_AGENT_TARGET, "$mail-transfer-agent", SPECIAL_MAIL_TRANSFER_AGENT_TARGET, - "$x-display-manager", SPECIAL_DISPLAY_MANAGER_TARGET, + "$x-display-manager", SPECIAL_DISPLAY_MANAGER_SERVICE }; unsigned i; @@ -340,9 +340,6 @@ static int service_load_sysv_path(Service *s, const char *path) { goto finish; } - s->type = SERVICE_FORKING; - s->restart = SERVICE_ONCE; - free(s->sysv_path); if (!(s->sysv_path = strdup(path))) { r = -ENOMEM; @@ -599,6 +596,19 @@ static int service_load_sysv_path(Service *s, const char *path) { u->meta.description = d; + } else if (startswith_no_case(t, "X-Interactive:")) { + int b; + + if ((b = parse_boolean(strstrip(t+14))) < 0) { + log_warning("[%s:%u] Couldn't parse interactive flag. Ignoring.", path, line); + continue; + } + + if (b) + s->exec_context.std_input = EXEC_INPUT_TTY; + else + s->exec_context.std_input = EXEC_INPUT_NULL; + } else if (state == LSB_DESCRIPTION) { if (startswith(l, "#\t") || startswith(l, "# ")) { @@ -637,8 +647,10 @@ static int service_load_sysv_path(Service *s, const char *path) { s->timeout_usec = 0; /* Special setting for all SysV services */ + s->type = SERVICE_FORKING; s->valid_no_process = true; s->kill_mode = KILL_PROCESS_GROUP; + s->restart = SERVICE_ONCE; u->meta.load_state = UNIT_LOADED; r = 0;