[rhel7/f20/master] Set environment variables in anaconda systemd shell file (#1023913)

mulhern amulhern at redhat.com
Fri Nov 1 13:23:00 UTC 2013


Resolves: rhbz#1023913

Previously, if the user entered anaconda shell, HOME was not set. Now
it is set to /, as it was in RHEL6.

PATH is explicitly set to the value it was before this change as it turns
out that a side-effect of setting HOME to / is that PATH is initialized
differently. A directory, /usr/local/sbin,  is prepended to this PATH
as a side-effect of login. The directory does not exist, so this should
have no effect.

PS1 is explicitly set to its previous value for the same reason PATH is set.

Signed-off-by: mulhern <amulhern at redhat.com>
---
 data/systemd/anaconda-shell at .service | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/data/systemd/anaconda-shell at .service b/data/systemd/anaconda-shell at .service
index 41c4469..b6ad52e 100644
--- a/data/systemd/anaconda-shell at .service
+++ b/data/systemd/anaconda-shell at .service
@@ -6,6 +6,9 @@ After=systemd-user-sessions.service plymouth-quit-wait.service
 
 [Service]
 WorkingDirectory=/
+Environment=HOME=/
+Environment=PATH=/bin:/sbin:/usr/bin:/usr/sbin:/mnt/sysimage/sbin:/mnt/sysimage/usr/sbin:/mnt/sysimage/bin:/mnt/sysimage/usr/bin
+Environment="PS1=[anaconda \u@\h \W]\$ "
 ExecStart=-/sbin/agetty -n -l /bin/bash -o '--login' %I 38400
 Restart=always
 RestartSec=0
-- 
1.8.3.1



More information about the anaconda-patches mailing list