chiark / gitweb /
service: interpret Debian-style X-Interactive LSB header field
[elogind.git] / src / service.c
index d4b874d62432292361625c198e709349fa964550..8ff7b73138016a9a4ace7991574df55a3c6a57cd 100644 (file)
@@ -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;
@@ -599,6 +599,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, "#  ")) {