]> git.decadent.org.uk Git - nfs-utils.git/blob - debian/nfs-common.postinst
Imported Debian patch 1.0.8-2
[nfs-utils.git] / debian / nfs-common.postinst
1 #!/bin/sh -e
2
3 #DEBHELPER#
4
5 case "$1" in
6     configure)
7         ucf --three-way /usr/share/nfs-common/conffiles/idmapd.conf /etc/idmapd.conf
8         ucf --three-way /usr/share/nfs-common/conffiles/nfs-common.default /etc/default/nfs-common
9
10         update-rc.d nfs-common defaults 21 79 >/dev/null
11
12         if ! getent passwd statd >/dev/null; then
13             adduser --system --home /var/lib/nfs --no-create-home statd
14         fi
15         if dpkg --compare-versions "$2" ge 1:1.0.7-10 && dpkg --compare-versions "$2" lt 1:1.0.7-13; then
16             usermod --home /var/lib/nfs statd || true
17             if [ -d /home/statd ]; then
18                 rmdir --ignore-fail-on-non-empty /home/statd
19             fi
20         fi
21         if [ "$2" = "" ] || dpkg --compare-versions "$2" lt 1:1.0.7-16; then
22             chown statd /var/lib/nfs/sm \
23                 /var/lib/nfs/sm.bak \
24                 /var/lib/nfs/rpc_pipefs \
25                 /var/lib/nfs
26             if [ -f /var/lib/nfs/state ]; then
27                 chown statd /var/lib/nfs/state
28             fi
29         fi
30     ;;
31 esac
32
33 act="restart"
34 [ "$1:$2" = "configure:" ] && act="start"
35 invoke-rc.d nfs-common $act