[systemd-commits] 2 commits - src/main.c src/service.c TODO
Lennart Poettering
lennart at kemper.freedesktop.org
Mon Oct 25 17:32:48 PDT 2010
TODO | 2 ++
src/main.c | 6 ++++--
src/service.c | 10 +++++++++-
3 files changed, 15 insertions(+), 3 deletions(-)
New commits:
commit 9865f3b4cacabf78ddfdca5973c44cecbbf3d2a5
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Oct 26 02:32:42 2010 +0200
service: make sure to pass TERM=linux to all sysv scripts
diff --git a/src/service.c b/src/service.c
index 7a522bf..dac4ada 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,
commit 39439087bf398c7d5b5baf1e79460f439b2f5ad9
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Oct 26 02:32:02 2010 +0200
main: don't unset HOME/TERM when run in session mode
diff --git a/TODO b/TODO
index 9a7ee43..938ee49 100644
--- a/TODO
+++ b/TODO
@@ -82,6 +82,8 @@
* make sure swap.target doesn't pull in partitions multiple times
+* make description of .swap files nicer: resolve /dev/by-uuid/ symlink
+
External:
* patch kernel to add /proc/swaps change notifications
diff --git a/src/main.c b/src/main.c
index 9a51a91..50325e1 100644
--- a/src/main.c
+++ b/src/main.c
@@ -975,8 +975,10 @@ int main(int argc, char *argv[]) {
/* Unset some environment variables passed in from the kernel
* that don't really make sense for us. */
- unsetenv("HOME");
- unsetenv("TERM");
+ if (arg_running_as == MANAGER_SYSTEM) {
+ unsetenv("HOME");
+ unsetenv("TERM");
+ }
/* Move out of the way, so that we won't block unmounts */
assert_se(chdir("/") == 0);
More information about the systemd-commits
mailing list