service: make sure to pass TERM=linux to all sysv scripts

This commit is contained in:
Lennart Poettering 2010-10-26 02:32:42 +02:00
parent 39439087bf
commit 9865f3b4ca
1 changed files with 9 additions and 1 deletions

View File

@ -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,