diff options
author | Chris Lumens <clumens@redhat.com> | 2010-08-11 10:38:13 -0400 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2010-08-11 10:38:13 -0400 |
commit | a56d705e00d62336f732f28382b129caee706845 (patch) | |
tree | fa7a3573a076d381bea53aa176d547c290c3a9ef /pyanaconda/desktop.py | |
parent | 9207f31b0f5b3ef5d7d21947563fb4ebc2455fb3 (diff) | |
download | anaconda-a56d705e00d62336f732f28382b129caee706845.tar.gz anaconda-a56d705e00d62336f732f28382b129caee706845.tar.xz anaconda-a56d705e00d62336f732f28382b129caee706845.zip |
Update systemd's default.target for the desired runlevel (#623102, mschmidt).
Diffstat (limited to 'pyanaconda/desktop.py')
-rw-r--r-- | pyanaconda/desktop.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pyanaconda/desktop.py b/pyanaconda/desktop.py index 49b7bbefd..306e481a1 100644 --- a/pyanaconda/desktop.py +++ b/pyanaconda/desktop.py @@ -19,7 +19,7 @@ # Author(s): Matt Wilson <msw@redhat.com> # -import string +import string, os from simpleconfig import SimpleConfigFile import logging @@ -65,6 +65,14 @@ class Desktop (SimpleConfigFile): inittab.write (line) inittab.close () + if not os.path.isdir(instPath + '/etc/systemd/system'): + log.warning("there is no /etc/systemd/system directory, cannot update default.target!") + return + default_target = instPath + '/etc/systemd/system/default.target' + if os.path.islink(default_target): + os.unlink(default_target) + os.symlink('/etc/systemd/system/runlevel' + str(self.runlevel) + '.target', default_target) + if self.getDefaultDesktop(): f = open(instPath + "/etc/sysconfig/desktop", "w") f.write(str (self)) |