]> git.decadent.org.uk Git - nfs-utils.git/blob - debian/nfs-common.postinst
Meh, revert accidental autotools diff in the git tree
[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
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         
35         if [ "$2" != "" ] || dpkg --compare-versions "$2" lt 1:1.1.0-14; then
36             if dpkg-statoverride --list /sbin/mount.nfs >/dev/null 2>&1; then
37                 dpkg-statoverride --remove /sbin/mount.nfs
38             fi
39         fi
40
41         # Migrate /lib/init/rw/sendsigs.omit.statd to /run.
42         if [ -f /lib/init/rw/sendsigs.omit.d/statd ]; then 
43             mv /lib/init/rw/sendsigs.omit.d/statd /run/sendsigs.omit.d/statd
44         fi
45     ;;
46 esac
47
48 act="restart"
49 [ "$1:$2" = "configure:" ] && act="start"
50 invoke-rc.d nfs-common $act