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