~ubuntu-branches/ubuntu/maverick/bind9/maverick

« back to all changes in this revision

Viewing changes to debian/postinst

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones, LaMont Jones, Internet Software Consortium, Inc, localization folks
  • Date: 2008-08-02 14:20:20 UTC
  • mfrom: (1.2.1 upstream) (6.1.24 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080802142020-l1hon9jy8lbbjxmg
[LaMont Jones]

* default to using resolvconf if it is installed
* fix sonames and dependencies.  Closes: #149259, #492418
* Do not build-depend libcap2-dev on non-linux.  Closes: #493392
* drop unused query-loc manpage.  Closes: #492564
* lwresd: Deliver /etc/bind directory.  Closes: #490027
* fix query-source comment in default install

[Internet Software Consortium, Inc]

* 9.5.0-P2.  Closes: #492949

[localization folks]

* l10n: Spanish debconf translation.  Closes: #492425 (Ignacio Mondino)
* l10n: Swedish debconf templates.  Closes: #491369 (Martin Ågren)
* l10n: Japanese debconf translations.  Closes: #492048 (Hideki Yamane
  (Debian-JP))
* l10n: Finnish translation.  Closes: #490630 (Esko Arajärvi)
* l10n: Italian debconf translations.  Closes: #492587 (Alessandro Vietta)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
 
3
 
set -e
4
 
 
5
 
if [ "$1" = configure ]; then
6
 
    lastversion="$2";
7
 
 
8
 
    # lets give them a bind user/group in all cases.
9
 
    # I wish there was an easier way to tell if it's there..
10
 
    touch /var/run/bind9.$$
11
 
    chgrp bind /var/run/bind9.$$ >/dev/null 2>&1 || addgroup --system bind
12
 
    chown bind /var/run/bind9.$$ >/dev/null 2>&1 ||
13
 
        adduser --system --home /var/cache/bind --no-create-home \
14
 
                --disabled-password --ingroup bind bind
15
 
    rm -f /var/run/bind9.$$
16
 
 
17
 
    if [ ! -s /etc/bind/rndc.key ]; then
18
 
        rndc-confgen -r /dev/urandom -a
19
 
    fi
20
 
 
21
 
    localconf=""
22
 
    if [ ! -f /etc/default/bind9 ]; then
23
 
        for file in /etc/bind/named.conf /etc/bind/named.conf.local; do
24
 
            theirs=$(md5sum $file | sed 's/ .*$//')
25
 
            mine=$(dpkg --status bind9 | grep "^ $file " | sed -n 's/.* //p')
26
 
            if [ "$mine" != "$theirs" ]; then
27
 
                localconf="y"
28
 
            fi
29
 
        done
30
 
        if [ -n "$localconf" ]; then
31
 
            echo 'OPTIONS=""' >> /etc/default/bind9
32
 
        else
33
 
            echo 'OPTIONS="-u bind"' >> /etc/default/bind9
34
 
        fi
35
 
        echo '# Set RESOLVCONF=no to not run resolvconf' >> /etc/default/bind9
36
 
        echo 'RESOLVCONF=yes' >> /etc/default/bind9
37
 
    fi
38
 
 
39
 
    # Deal with the aftermath of 9.2.1-5  - it's a hack, but hey..
40
 
    if [ "$lastversion" = "9.2.1-5" ]; then
41
 
        ugid=$(ls -l /etc/bind/rndc.key | awk '{print $3 $4}')
42
 
        if [ "$ugid" = "bindbind" ]; then
43
 
            chown root:root /etc/bind/rndc.key
44
 
            chown root:bind /var/run/bind/run
45
 
            chown root:bind /var/cache/bind
46
 
        fi
47
 
    fi
48
 
 
49
 
    uid=$(ls -ln /etc/bind/rndc.key | awk '{print $3}')
50
 
    if [ "$uid" = "0" ]; then
51
 
        [ -n "$localconf" ] || chown bind /etc/bind/rndc.key
52
 
        chgrp bind /etc/bind
53
 
        chmod g+s /etc/bind
54
 
        chgrp bind /etc/bind/rndc.key /var/run/bind/run /var/cache/bind
55
 
        chgrp bind /etc/bind/named.conf*
56
 
        chmod g+r /etc/bind/rndc.key /etc/bind/named.conf*
57
 
        chmod g+rwx /var/run/bind/run /var/cache/bind
58
 
    fi
59
 
 
60
 
    if [ -x /etc/init.d/bind9 ]; then
61
 
        update-rc.d bind9 defaults 15 85 >/dev/null
62
 
    fi
63
 
 
64
 
fi
65
 
 
66
 
 
67
 
#DEBHELPER#