summaryrefslogtreecommitdiffstats
path: root/lib/Xconfig
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2011-11-07 11:22:36 +0000
committerColin Guthrie <colin@mageia.org>2011-11-07 11:22:36 +0000
commit84c677f03575913899765fc316bfd71e4fb36ede (patch)
treef4db34e6721311c0c3401ed950ce8df0a376341e /lib/Xconfig
parentd0d4bfab1c372e13d1dd7c5640cdb7574caafdcf (diff)
downloaddrakx-kbd-mouse-x11-84c677f03575913899765fc316bfd71e4fb36ede.tar
drakx-kbd-mouse-x11-84c677f03575913899765fc316bfd71e4fb36ede.tar.gz
drakx-kbd-mouse-x11-84c677f03575913899765fc316bfd71e4fb36ede.tar.bz2
drakx-kbd-mouse-x11-84c677f03575913899765fc316bfd71e4fb36ede.tar.xz
drakx-kbd-mouse-x11-84c677f03575913899765fc316bfd71e4fb36ede.zip
Ensure we update the default systemd target when setting runlevel.
Diffstat (limited to 'lib/Xconfig')
-rw-r--r--lib/Xconfig/various.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Xconfig/various.pm b/lib/Xconfig/various.pm
index ab077f5..32db2fa 100644
--- a/lib/Xconfig/various.pm
+++ b/lib/Xconfig/various.pm
@@ -227,6 +227,12 @@ sub runlevel {
-r $f or log::l("missing inittab!!!"), return;
if ($o_runlevel) {
substInFile { s/^id:\d:initdefault:\s*$/id:$o_runlevel:initdefault:\n/ } $f if !$::testing;
+ my $t = "$::prefix/lib/systemd/system/runlevel$o_runlevel.target";
+ if (!$::testing && -f $t) {
+ my $d = "$::prefix/etc/systemd/system/default.target";
+ unlink($d);
+ symlink($t, "$::prefix/etc/systemd/system/default.target");
+ }
} else {
cat_($f) =~ /^id:(\d):initdefault:\s*$/m && $1;
}