postinst is in runit 2.1.1-6.2ubuntu2.
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | #!/bin/sh
set -e
test "$1" = 'configure' || exit 0
mv_conffile() {
test -e "$1" || return 0
echo "Preserving user changes to $2..." >&2
mv -f "$2" "$2".dpkg-new
mv -f "$1" "$2"
}
if dpkg --compare-versions "$2" lt '1.4.0-0'; then
mv_conffile /etc/runit/getty-5/run /etc/sv/getty-5/run
mv_conffile /etc/runit/getty-5/finish /etc/sv/getty-5/finish
rmdir /etc/runit/getty-5 2>/dev/null || :
fi
if test -z "$2"; then
# not upgrading
if grep '^SV:' /etc/inittab >/dev/null; then
if ! grep '^#-- runit begin' /etc/inittab >/dev/null; then
cat <<\EOT >&2
There already is an SV entry in /etc/inittab. In order to have this package
add an entry with the name SV to have runit's service supervision started
by sysvinit, you need to remove or rename the current SV entry first.
Installation failed.
EOT
exit 1
fi
fi
fi
if [ -f /etc/inittab ] && ! grep '^SV:' /etc/inittab >/dev/null; then
cp /etc/inittab /etc/inittab'{new}'
cat >>/etc/inittab'{new}' <<-\EOT
#-- runit begin
SV:123456:respawn:/usr/sbin/runsvdir-start
#-- runit end
EOT
mv -f /etc/inittab'{new}' /etc/inittab
fi
if ps -p 1 >/dev/null; then
kill -s HUP 1
fi
# remove lingering debconf-managed configuration
# from versions 2.1.0-1 through 2.1.1-6.1.
if test -r /usr/share/debconf/confmodule; then
. /usr/share/debconf/confmodule
db_purge
fi
if [ -x /sbin/start ]; then #provided by upstart
/sbin/start runsvdir
fi
|