PREUN
/bin/sh
if [ $1 -eq 0 ] ; then
/usr/bin/systemctl --quiet disable \
getty@.service \
remote-fs.target \
2>&1 || :
/usr/bin/rm -f /etc/systemd/system/default.target 2>&1 || :
fi
POSTIN
/bin/sh
if [ $1 -eq 1 ] ; then
# Try to read default runlevel from the old inittab if it exists
runlevel=$(/usr/bin/awk -F ':' '$3 == "initdefault" && $1 !~ "^#" { print $2 }' /etc/inittab 2> /dev/null)
if [ -z "$runlevel" ] ; then
target="/usr/lib/systemd/system/multi-user.target"
else
target="/usr/lib/systemd/system/runlevel$runlevel.target"
fi
# And symlink what we found to the new-style default.target
/usr/bin/ln -sf "$target" /etc/systemd/system/default.target || :
# Enable the services we install by default.
/usr/bin/systemctl --quiet preset \
remote-fs.target \
getty@.service \
serial-getty@.service \
console-getty.service \
console-shell.service \
debug-shell.service \
systemd-timesyncd.service \
systemd-networkd.service \
systemd-networkd-wait-online.service \
systemd-resolved.service \
2>/dev/null || :
fi
hostname_new=`cat /etc/hostname 2>/dev/null`
if [ -z $hostname_new ]; then
hostname_old=`cat /etc/sysconfig/network 2>/dev/null | grep HOSTNAME | cut -d "=" -f2`
if [ ! -z $hostname_old ]; then
echo $hostname_old >> /etc/hostname
else
echo "localhost" >> /etc/hostname
fi
fi
POSTUN
/bin/sh
if [ $1 -ge 1 ] ; then
/usr/bin/systemctl daemon-reload 2>&1 || :
fi
Triggers
systemd-units <
215
/bin/sh
# Enable the services we install by default.
/usr/bin/systemctl --quiet preset systemd \
remote-fs.target \
getty@.service \
serial-getty@.service \
console-getty.service \
console-shell.service \
debug-shell.service \
systemd-timesyncd.service \
systemd-networkd.service \
systemd-networkd-wait-online.service \
systemd-resolved.service \
2>/dev/null || :
# rc-local is now enabled by default in base package
# and read-ahead stuff is no more
rm -f /etc/systemd/system/multi-user.target.wants/rc-local.service \
/etc/systemd/system/default.target.wants/systemd-readahead-{collect,replay}.service || :
# automatic systemd release on rpm installs/removals
# (see http://wiki.mandriva.com/en/Rpm_filetriggers)
# (cg) I'm not sure if the file list check works against the packaged rpm
# or what is installed, so I've added both the /lib and /usr/lib paths
# below, even thought the former is just a symlink to the latter