From 9cf73c9e6387e681ae6a991ac003ef920835c27f Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sat, 3 Nov 2018 17:58:51 +0000 Subject: Fix setting systemd default.target to requested runlevel (mga#22593) --- NEWS | 2 ++ lib/Xconfig/various.pm | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index e7be5f2..1c712f5 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +- fix setting systemd default.target to requested runlevel (mga#22593) + Version 1.24 - 22 June 2018 - correct Serbian and Yugoslavian xkb symbols file (martinw, mga#22157) diff --git a/lib/Xconfig/various.pm b/lib/Xconfig/various.pm index d98df16..7d245f2 100644 --- a/lib/Xconfig/various.pm +++ b/lib/Xconfig/various.pm @@ -225,9 +225,10 @@ sub config { sub runlevel { my ($o_runlevel) = @_; + # inittab is no more, but we may still need this for upgrades my $f = "$::prefix/etc/inittab"; - -r $f or log::l("missing inittab!!!"), return; if ($o_runlevel) { + log::l("setting runlevel to $o_runlevel"); substInFile { s/^id:\d:initdefault:\s*$/id:$o_runlevel:initdefault:\n/ } $f if !$::testing; my $t = "/lib/systemd/system/runlevel$o_runlevel.target"; if (!$::testing && -f "$::prefix$t") { -- cgit v1.2.1