summaryrefslogtreecommitdiff
path: root/src/core/service.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-01-28 16:25:39 +0100
committerLennart Poettering <lennart@poettering.net>2016-01-28 16:25:39 +0100
commit1e22b5cda04b6d5e0dd83ab8e6ecb452cf34851f (patch)
tree58d2d9b1596fa7b70259bc93e47c125903a403c1 /src/core/service.c
parentcd72d2044ad28b475bf84a38ba6db45292467dd8 (diff)
core: don't reset /dev/console if stdin/stdout/stderr as passed as fd in a transient service
Otherwise we might end resetting /dev/console all the time when a transient service starts or stops. Fixes #2377 Fixes #2198 Fixes #2061
Diffstat (limited to 'src/core/service.c')
-rw-r--r--src/core/service.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/service.c b/src/core/service.c
index ae84cccbc8..355de3e15d 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -2363,6 +2363,7 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value,
else {
asynchronous_close(s->stdin_fd);
s->stdin_fd = fdset_remove(fds, fd);
+ s->exec_context.stdio_as_fds = true;
}
} else if (streq(key, "stdout-fd")) {
int fd;
@@ -2372,6 +2373,7 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value,
else {
asynchronous_close(s->stdout_fd);
s->stdout_fd = fdset_remove(fds, fd);
+ s->exec_context.stdio_as_fds = true;
}
} else if (streq(key, "stderr-fd")) {
int fd;
@@ -2381,6 +2383,7 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value,
else {
asynchronous_close(s->stderr_fd);
s->stderr_fd = fdset_remove(fds, fd);
+ s->exec_context.stdio_as_fds = true;
}
} else
log_unit_debug(u, "Unknown serialization key: %s", key);