- Import commit 9e0985dc330b1cf04bc44049962343bdf4ba851a
4fd7cd041 pam_logind: skip leading /dev/ from PAM_TTY field before passing it on dd6312828 logind: make sure we don't process the same method call twice (#6583) - Update scripts-systemd-upgrade-from-pre-210.sh script - drop dependency on awk - fallback to runlevel #3 if something goes wrong Note: I'm not sure how this is supposed to work as /etc/inittab is likely to be missing in my understanding. Indeed this file is part of the aaa_base package which might be upgraded before systemd is installed... - Drop macros.systemd.upstream as it's not used OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=989
This commit is contained in:
@@ -8,12 +8,18 @@
|
||||
# All hacks can potentially break the admin settings since they work
|
||||
# in /etc...
|
||||
|
||||
# Try to read default runlevel from the old inittab if it exists
|
||||
# Try to read default runlevel from the old inittab if it exists. If
|
||||
# it fails fallback to runlevel 3 which should still be better than
|
||||
# the rescue shell.
|
||||
#
|
||||
# Note: /etc/inittab was part of the aaa_base package which can be
|
||||
# upgraded before systemd is. Therefore this file is likely to be
|
||||
# missing.
|
||||
if [ ! -e /etc/systemd/system/default.target -a -e /etc/inittab ]; then
|
||||
runlevel=$(awk -F ':' '$3 == "initdefault" && $1 !~ "^#" { print $2 }' /etc/inittab)
|
||||
if [ -n "$runlevel" ] ; then
|
||||
ln -sf /usr/lib/systemd/system/runlevel$runlevel.target /etc/systemd/system/default.target
|
||||
fi
|
||||
runlevel=$(sed -n -r "s/^id:([[:digit:]]):initdefault:/\1/p" /etc/inittab)
|
||||
: ${runlevel:=3}
|
||||
echo "Initializing default.target to runlevel${runlevel}.target"
|
||||
ln -s /usr/lib/systemd/system/runlevel${runlevel}.target /etc/systemd/system/default.target
|
||||
fi
|
||||
|
||||
# since v207 /etc/sysctl.conf is no longer parsed, however
|
||||
|
Reference in New Issue
Block a user