~ubuntu-branches/ubuntu/lucid/nfs-utils/lucid

15 by Steve Langasek
* Drop nfs-common init script in favor of new upstart jobs. LP: #431248.
1
# gssd - rpcsec_gss daemon
2
3
# The rpcsec_gss protocol gives a means of using the GSS-API generic security
4
# API to provide security for protocols using RPC (in particular, NFS).
5
6
description	"rpcsec_gss daemon"
7
author		"Steve Langasek <steve.langasek@canonical.com>"
8
20 by Steve Langasek
Drop the gssd upstart job's dependency on "local-filesystems"; at boot
9
start on (started portmap
29 by Steve Langasek
* debian/nfs-common.gssd.upstart:
10
          or mounting TYPE=nfs4 OPTIONS=*sec*krb5*)
16 by Steve Langasek
* Configure gssd and idmapd upstart jobs to stop on runlevels 0 and 6; this
11
stop on (stopping portmap or runlevel [06])
15 by Steve Langasek
* Drop nfs-common init script in favor of new upstart jobs. LP: #431248.
12
13
expect fork
14
respawn
15
16
env DEFAULTFILE=/etc/default/nfs-common
17
18
pre-start script
19
	do_modprobe() {
20
		modprobe -q "$1" || true
21
	}
22
23
	if [ -f "$DEFAULTFILE" ]; then
24
		. "$DEFAULTFILE"
25
	fi
26
27
	#
28
	# Parse the fstab file, and determine whether we need gssd. (The
29
	# /etc/defaults settings, if any, will override our autodetection.)
30
	# This code is partially adapted from the mountnfs.sh script in the
31
	# sysvinit package.
32
33
	if [ -f /etc/fstab ]; then
34
		exec 9<&0 </etc/fstab
35
36
		while read DEV MTPT FSTYPE OPTS REST
37
		do
38
			case "$OPTS" in
16 by Steve Langasek
* Configure gssd and idmapd upstart jobs to stop on runlevels 0 and 6; this
39
				sec=krb5|*,sec=krb5|sec=krb5,*|*,sec=krb5,*|sec=krb5i|*,sec=krb5i|sec=krb5i,*|*,sec=krb5i,*|sec=krb5p|*,sec=krb5p|sec=krb5p,*|*,sec=krb5p,*)
15 by Steve Langasek
* Drop nfs-common init script in favor of new upstart jobs. LP: #431248.
40
					AUTO_NEED_GSSD=yes
41
					;;
42
			esac
43
		done
44
45
		exec 0<&9 9<&-
46
	fi
47
48
	case "$NEED_GSSD" in
49
		yes|no)
50
			;;
51
		*)
52
			NEED_GSSD=$AUTO_NEED_GSSD
53
			;;
54
	esac
19 by Steve Langasek
* Set upstart jobs to also start on mount attempt, in the event that
55
	[ "x$NEED_GSSD" = xyes ] || { stop; exit 0; }
15 by Steve Langasek
* Drop nfs-common init script in favor of new upstart jobs. LP: #431248.
56
57
	# we need this available; better to fail now than
58
	# mysteriously on the first mount
59
	if ! grep -q -E '^nfs[	 ]' /etc/services; then
60
		echo "broken /etc/services, please see /usr/share/doc/nfs-common/README.Debian.nfsv4"
61
		exit 1
62
	fi
63
64
	do_modprobe nfs
65
	do_modprobe nfsd
66
	do_modprobe rpcsec_gss_krb5
67
68
end script
69
29 by Steve Langasek
* debian/nfs-common.gssd.upstart:
70
exec rpc.gssd