postinst is in util-vserver 0.30.216-pre3120-1.4.
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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | #!/bin/sh
. /usr/share/debconf/confmodule
set -e
case "$1" in
configure)
# Remove older attr +t if present
if [ "`lsattr -d /var/lib/vservers/|cut -c16`" = "t" ] ; then
chattr -t /var/lib/vservers
fi
# UPGRADE PATH FROM vserver PACKAGE!
# It should be fairly fail safe.
# Source the old /etc/vserver.conf file to get the VROOTDIR
if [ -r /etc/vserver.conf ] ; then
. /etc/vserver.conf
if [ -n "$VSERVERS_ROOT" ] ; then
VROOTDIR="$VSERVERS_ROOT"
fi
if [ -n "$VSERVER_ROOT" ] ; then
VROOTDIR="$VSERVER_ROOT"
fi
rm /etc/vserver.conf
fi
# SOURCE the old /etc/vservers.conf file to get the VROOTDIR
if [ -r /etc/vservers.conf ] ; then
. /etc/vservers.conf
if [ -n "$VSERVERS_ROOT" ] ; then
VROOTDIR="$VSERVERS_ROOT"
fi
if [ -n "$VSERVER_ROOT" ] ; then
VROOTDIR="$VSERVER_ROOT"
fi
rm /etc/vservers.conf
fi
if [ -z $VROOTDIR ]
then
VROOTDIR=/var/lib/vservers
fi
if [ ! -e /etc/vservers/.defaults/vdirbase ] ; then
ln -s $VROOTDIR /etc/vservers/.defaults/vdirbase
fi
# Remove old startup scripts
rm -f /etc/init.d/vservers-legacy
rm -f /etc/init.d/vservers-default
rm -f /etc/init.d/vprocunhide
rm -f /etc/default/util-vservere
if [ -f /etc/init.d/rebootmgr ]
then
/etc/init.d/rebootmgr stop
rm -f /etc/init.d/rebootmgr
fi
# END OF UPGRADE PATH FROM vserver PACKAGE
if [ ! -e /etc/vservers/.defaults/run.rev ] ; then
mkdir -p /var/run/vservers.rev
ln -s /var/run/vservers.rev /etc/vservers/.defaults/run.rev
fi
test -d $VROOTDIR/.pkg || mkdir -m0755 $VROOTDIR/.pkg
test -d $VROOTDIR/.hash || mkdir -m0700 $VROOTDIR/.hash
hash="/etc/vservers/.defaults/apps/vunify/hash"
if [ -d $VROOTDIR/.hash ]; then
test -e "$hash"/method -o -e "$hash"/00 || \
ln -s $VROOTDIR/.hash "$hash"/00
fi
db_stop
;;
abort-upgrade|abort-remove|abort-deconfigure)
exit 0
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 0
;;
esac
# Automatically added by dh_installinit
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
if [ -x "/etc/init.d/util-vserver" ]; then
update-rc.d util-vserver defaults >/dev/null
invoke-rc.d util-vserver start || exit $?
fi
fi
# End automatically added section
exit 0
|