summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-10-26 02:32:42 +0200
committerLennart Poettering <lennart@poettering.net>2010-10-26 02:32:42 +0200
commit9865f3b4cacabf78ddfdca5973c44cecbbf3d2a5 (patch)
tree8f9dbde5a477df3c9065a1fd63552a565fc0a65c /src
parent39439087bf398c7d5b5baf1e79460f439b2f5ad9 (diff)
service: make sure to pass TERM=linux to all sysv scripts
Diffstat (limited to 'src')
-rw-r--r--src/service.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/service.c b/src/service.c
index 7a522bf3f4..dac4adaa6a 100644
--- a/src/service.c
+++ b/src/service.c
@@ -1568,7 +1568,7 @@ static int service_spawn(
goto fail;
}
- if (!(our_env = new0(char*, 3))) {
+ if (!(our_env = new0(char*, 4))) {
r = -ENOMEM;
goto fail;
}
@@ -1585,6 +1585,14 @@ static int service_spawn(
goto fail;
}
+ /* Make sure we set TERM=linux for SysV scripts, since some
+ * require it to be set from the kernel */
+ if (s->sysv_path && !strv_env_get(s->meta.manager->environment, "TERM"))
+ if (!(our_env[n_env++] = strdup("TERM=linux"))) {
+ r = -ENOMEM;
+ goto fail;
+ }
+
if (!(final_env = strv_env_merge(2,
s->meta.manager->environment,
our_env,