case "${1}" in
configure)
- if [ -e /run/systemd/system ]; then
+ if [ -d /lib/systemd/system ]
+ then
# Python packages put all data files in /usr, so we copy
# them to /lib at install time.
py_unit="/usr/share/doc/${pkg}/${pkg}.service"
then
cp "${py_unit}" /lib/systemd/system/
fi
+ fi
+ if [ -e /run/systemd/system ]; then
eval "$(systemctl -p UnitFileState show "${systemd_unit}")"
case "${UnitFileState}" in
disabled)
if [ -e /run/systemd/system ]; then
systemctl stop "${systemd_unit}" || true
systemctl disable "${systemd_unit}" || true
+ fi
- # Unit files from Python packages get installed by
- # postinst so we have to remove them explicitly here.
- py_unit="/usr/share/doc/${pkg}/${pkg}.service"
- if [ -e "${py_unit}" ]
- then
- rm "/lib/systemd/system/${pkg}.service" || true
- fi
+ # Unit files from Python packages get installed by postinst so
+ # we have to remove them explicitly here.
+ py_unit="/usr/share/doc/${pkg}/${pkg}.service"
+ if [ -e "${py_unit}" ]
+ then
+ rm "/lib/systemd/system/${pkg}.service" || true
fi
;;
esac