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 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
|
#!/bin/sh -e
case "$1" in
configure)
# continue below
;;
abort-upgrade|abort-remove|abort-deconfigure)
exit 0
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 0
;;
esac
# if nslookup.bind is a link, it's probably to nslookup.sh, whicn doesn't exist
if [ -L /usr/bin/nslookup.bind ]
then
rm -f /usr/bin/nslookup.bind
fi
umask 022
# cleanup ancient cruft
if [ "$2" ] && dpkg --compare-versions $2 lt 1:8.2.2p5-1
then
echo ""
echo "You appear to be upgrading from an old version of the Debian BIND"
echo "package. Since 8.2.1, Debian has used /etc/bind/named.conf as the"
echo "location of the configuration file for the daemon. You should"
echo "review /usr/share/doc/bind/README.Debian for an overview of the"
echo "filestructure used by BIND on Debian, and update your config."
fi
if [ -e /etc/named.boot ]
then
echo ""
echo "You have an /etc/named.boot file. This is a remnant from a BIND 4.x"
echo "version, or the Debian BIND package up through 8.1.2. We are not"
echo "prepared to try and update this for you automatically. You should"
echo "extract any relevant information, put it in /etc/bind/named.conf,"
echo "and then remove /etc/named.boot. Note that named.conf uses different"
echo "syntax than named.boot!"
echo ""
echo -n "Press <enter> to continue"
read yn
fi
if [ -e /etc/named.conf ]
then
echo ""
echo "You have an /etc/named.conf file. This is a remnant from a previous"
echo "package version. The new location for this configuration file is"
echo "/etc/bind/named.conf. Please review your configuration, put"
echo "everything relevant in /etc/bind/named.conf, then remove"
echo "/etc/named.conf"
echo ""
echo -n "Press <enter> to continue"
read yn
fi
if [ -d /var/named ]
then
echo ""
echo "You have a /var/named directory. Previous Debian packages used this"
echo "directory to hold zone data files. Please review the contents, move"
echo "any relevant configuration to /etc/bind as per the instructions in"
echo "/usr/share/doc/bind/README.Debian, and then remove the /var/named"
echo "directory. This package uses /var/cache/bind as the working directory,"
echo "and by default expects master zone files to be put in /etc/bind."
echo ""
echo -n "Press <enter> to continue"
read yn
fi
if [ "$2" ] && dpkg --compare-versions $2 lt 1:8.2.2p5-1
then
echo "WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING"
echo ""
echo "You are upgrading BIND from a version prior to 8.2.2p5-1. Enough has"
echo "changed, and enough problems existed with prior revisions of the"
echo "Debian BIND package, that no attempt has been made to auto-convert"
echo "your existing configuration. The daemon 'named' is about to be"
echo "launched using /etc/bind/named.conf. Until you manually convert"
echo "your configuration, you will have a functional leaf nameserver,"
echo "but any zones you are authoritative for will be 'broken' until you"
echo "convert to the new configuration schema by hand. See the file"
echo "/usr/share/doc/bind/README.Debian for more information!"
echo ""
echo "WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING"
echo ""
echo -n "Press <enter> to continue"
read yn
fi
# Don't just look at $1, since we might or might not have a running daemon,
# regardless of whether this is an upgrade...
#
# If there is a unix domain socket /var/run/ndc, named is running and we want
# to tell it to restart, which will execvp the new daemon. If no such socket
# exists, we can't tell if named is running, and we need to kill any named
# processes that exist, and then start it... this might be an initial install,
# or it could be a very old version of named.
#
if [ -S /var/run/ndc ]; then
echo -n "Restarting named... "
if which invoke-rc.d >/dev/null 2>&1; then
invoke-rc.d bind restart
else
/etc/init.d/bind restart
fi
else
/bin/kill `/bin/pidof /usr/sbin/named` 2>/dev/null || /bin/true
if which invoke-rc.d >/dev/null 2>&1; then
invoke-rc.d bind start
else
/etc/init.d/bind start
fi
fi
if [ -x /etc/init.d/bind ]; then
update-rc.d bind defaults 15 85 >/dev/null
fi
#DEBHELPER#
exit 0
|