preinst is in runit 2.1.2-9.2ubuntu1.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | #!/bin/sh
set -eux
# Ugly hack to make upgrade from every previous version
# smooth and `piuparts'-clean.
if [ "$1" = upgrade ] ; then
case "$2" in
2.1.2-3)
# Leaving files behind is bug in version 2.1.2-3, but
# let's do our best to workaround it at upgrade.
rm -f /etc/sv/getty-5/run /etc/sv/getty-5/finish
rmdir --ignore-fail-on-non-empty /etc/sv/getty-5
rm -f /etc/systemd/system/multi-user.target.wants/runit.service
# Actually only to make piuparts happy. This directory
# will be created by first -run package anyway.
rmdir --ignore-fail-on-non-empty /etc/sv
;;
2.1.2-6)
find /etc/runit
rm -f /etc/runit/runsvdir/current
rmdir --ignore-fail-on-non-empty /etc/runit/runsvdir/
rmdir --ignore-fail-on-non-empty /etc/runit
;;
esac
fi
|