systemd/debian/systemd.preinst

27 lines
876 B
Bash

#! /bin/sh
set -e
if [ "$1" = "install" ] || [ "$1" = "upgrade" ] && [ -n "$2" ] && dpkg --compare-versions "$2" lt "44-3"; then
rm -f /lib/lsb/init-functions
dpkg-divert --remove --package systemd --rename \
--divert /lib/lsb/init-functions.systemd /lib/lsb/init-functions
fi
# This function copies a unit file to /run/systemd/system/ (unless the target
# path already exists).
# This is necessary at least for certain .mount units when upgrading from 44 to
# 204, see http://bugs.debian.org/723936
preserve_unit() {
if [ ! -e /run/systemd/system/$1 ]; then
cp /lib/systemd/system/$1 /run/systemd/system/$1
fi
}
if [ "$1" = "install" ] || [ "$1" = "upgrade" ] && [ -n "$2" ] && dpkg --compare-versions "$2" lt "204-1" && [ -d /run/systemd/system ]; then
preserve_unit "var-lock.mount"
preserve_unit "var-run.mount"
fi
#DEBHELPER#