diff options
author | Evan Callicoat <apsu@propter.net> | 2013-09-23 21:01:04 -0500 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-10-01 04:17:31 +0200 |
commit | e6dca814412f17db05910acedf76d36d3b7f1355 (patch) | |
tree | c3ada0411c5250d9b036a5e2aa5ae8a6c9336928 | |
parent | build-sys: don't fallback to upstart defaults (diff) | |
download | systemd-e6dca814412f17db05910acedf76d36d3b7f1355.tar.gz systemd-e6dca814412f17db05910acedf76d36d3b7f1355.tar.bz2 systemd-e6dca814412f17db05910acedf76d36d3b7f1355.zip |
units: Add SHELL environment variable
With the advent of systemd --user sessions, it's become very interesting to spawn X as a user unit, as well as accompanying processes that may have previously been in a .xinitrc/.xsession, or even just to replace a collection of XDG/GDM/KDM/etc session files with independent systemd --user units. The simplest case here would be to login on a tty, with the traditional /usr/sbin/login "login manager".
However, systemd --user (spawned by user@.service) is at the top level of the slice for the user, and does not inherit any environment variables from the login process. Given the number of common applications which rely on SHELL being set in the environment, it seems like the cleanest way to provide this variable is to set it to %s in the user@.service.
Ideally in the long-term, applications which rely on SHELL being set should be fixed to just grab it from getpwnam() or similar, but until that becomes more common, I propose this simple change to make user sessions a little bit nicer out of the box.
-rw-r--r-- | units/user@.service.in | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/units/user@.service.in b/units/user@.service.in index 3f8b59d07..3718a5708 100644 --- a/units/user@.service.in +++ b/units/user@.service.in @@ -13,6 +13,7 @@ After=systemd-user-sessions.service User=%I PAMName=systemd-user Type=notify +Environment=SHELL=%s ExecStart=-@rootlibexecdir@/systemd --user Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%I/dbus/user_bus_socket Slice=user-%i.slice |