static int sysv_translate_facility(const char *name, char **_r) {
static const char * const table[] = {
+ /* LSB defined facilities */
"$local_fs", SPECIAL_LOCAL_FS_TARGET,
"$network", SPECIAL_NETWORK_TARGET,
"$named", SPECIAL_NSS_LOOKUP_TARGET,
"$portmap", SPECIAL_RPCBIND_TARGET,
"$remote_fs", SPECIAL_REMOTE_FS_TARGET,
"$syslog", SPECIAL_SYSLOG_TARGET,
- "$time", SPECIAL_RTC_SET_TARGET
+ "$time", SPECIAL_RTC_SET_TARGET,
+
+ /* Debian extensions */
+ "$mail-transport-agent", SPECIAL_MAIL_TRANSFER_AGENT_TARGET,
+ "$mail-transfer-agent", SPECIAL_MAIL_TRANSFER_AGENT_TARGET,
+ "$x-display-manager", SPECIAL_DISPLAY_MANAGER_SERVICE
};
unsigned i;
/* Try to parse Red Hat style chkconfig headers */
- if (startswith(t, "chkconfig:")) {
+ if (startswith_no_case(t, "chkconfig:")) {
int start_priority;
char runlevels[16], *k;
s->sysv_runlevels = d;
}
- } else if (startswith(t, "description:")) {
+ } else if (startswith_no_case(t, "description:")) {
size_t k = strlen(t);
char *d;
free(u->meta.description);
u->meta.description = d;
- } else if (startswith(t, "pidfile:")) {
+ } else if (startswith_no_case(t, "pidfile:")) {
char *fn;
} else if (state == LSB || state == LSB_DESCRIPTION) {
- if (startswith(t, "Provides:")) {
+ if (startswith_no_case(t, "Provides:")) {
char *i, *w;
size_t z;
goto finish;
}
- } else if (startswith(t, "Required-Start:") ||
- startswith(t, "Should-Start:") ||
- startswith(t, "X-Start-Before:") ||
- startswith(t, "X-Start-After:")) {
+ } else if (startswith_no_case(t, "Required-Start:") ||
+ startswith_no_case(t, "Should-Start:") ||
+ startswith_no_case(t, "X-Start-Before:") ||
+ startswith_no_case(t, "X-Start-After:")) {
char *i, *w;
size_t z;
if (r == 0)
continue;
- r = unit_add_dependency_by_name(u, startswith(t, "X-Start-Before:") ? UNIT_BEFORE : UNIT_AFTER, m, NULL, true);
+ r = unit_add_dependency_by_name(u, startswith_no_case(t, "X-Start-Before:") ? UNIT_BEFORE : UNIT_AFTER, m, NULL, true);
free(m);
if (r < 0)
goto finish;
}
- } else if (startswith(t, "Default-Start:")) {
+ } else if (startswith_no_case(t, "Default-Start:")) {
char *k, *d;
state = LSB;
s->sysv_runlevels = d;
}
- } else if (startswith(t, "Description:")) {
+ } else if (startswith_no_case(t, "Description:")) {
char *d;
state = LSB_DESCRIPTION;
free(u->meta.description);
u->meta.description = d;
- } else if (startswith(t, "Short-Description:") &&
+ } else if (startswith_no_case(t, "Short-Description:") &&
!u->meta.description) {
char *d;
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, "# ")) {