systemd/scripts-systemd-upgrade-from-pre-210.sh
Franck Bui b57d88135f Accepting request 599905 from home:fbui:systemd:Factory
- Import commit d8196805089566ecd846b7c627ff2f3c42588c50
  621b247f3 device: skip deserialization of device units when udevd is not running
  a7da5bdbc device: make sure to always retroactively start device dependencies (bsc#1088052)
  303624f6f systemd-udevd: limit children-max by available memory () (bsc#1086785 bsc#1066422)
  76acf3ae9 tmpfiles: fix directory removal with force symlink ()

- Ship 99-sysctl.conf instead of creating it during package installation/update (bsc#1088769)
  Previously this symlink was created in /etc/sysctl.d during %post
  which made the symlink not owned and more importantly it was created
  only if /etc/sysctl.conf is already installed which is not always
  the case during the installation process it seems.
  So ship the symlink unconditionally and put it in /usr/lib/sysctl.d
  instead since it's a distro default behavior that might be overriden
  by sysadmin later.

- Be consistent in 60-io-scheduler.rules
  And use "?*" when checking for the non empty string (instead of "*?").

OBS-URL: https://build.opensuse.org/request/show/599905
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1027
2018-04-23 08:01:18 +00:00

31 lines
1.1 KiB
Bash

#! /bin/bash
#
# This script is supposed to be executed from the %post section. It
# contains all hacks needed to update a system which was running
# systemd < v210. This also includes systems migrating from SysV.
#
# 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. 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=$(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
# migrate any symlink which may refer to the old path
for f in $(find /etc/systemd/system -type l -xtype l); do
new_target="/usr$(readlink $f)"
[ -f "$new_target" ] && ln -s -f $new_target $f
done