]> git.pld-linux.org Git - packages/nfs-utils.git/blame - rpcidmapd.init
- init scripts for NFSv4 RPC daemons
[packages/nfs-utils.git] / rpcidmapd.init
CommitLineData
8ca940f0
JR
1#!/bin/bash
2#
3# rpcidmapd Start up and shut down RPC name to UID/GID mapper
4#
5# Authors: Chuck Lever <cel@netapp.com>
6#
7# chkconfig: 345 13 82
8# description: Starts user-level daemon for NFSv4 that maps user \
9# names to UID and GID numbers.
10
11# Source function library.
12. /etc/rc.d/init.d/functions
13
14# Get network config
15. /etc/sysconfig/network
16
17# Check that networking is up.
18if is_yes "${NETWORKING}"; then
19 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
20 msg_network_down "RPC svcgssd daemon"
21 exit 1
22 fi
23else
24 exit 0
25fi
26
27if [ -x /sbin/pidof ] && [ "$1" != "stop" ]; then
28 [ -z "`/sbin/pidof portmap`" ] && nls "Error: portmap isn't running" && exit 0
29fi
30
31# Get service config
32[ -f /etc/sysconfig/nfsfs ] && . /etc/sysconfig/nfsfs
33[ -f /etc/sysconfig/nfsd ] && . /etc/sysconfig/nfsd
34
35# /usr may be on NFS, fail silently, nfsfs will start it
36[ -x /usr/sbin/rpc.idmapd ] || exit 0
37
38RETVAL=0
39
40# See how we were called.
41case "$1" in
42 start)
43 # Check if the service is already running?
44 if [ ! -f /var/lock/subsys/idmapd ]; then
45 if ! grep -q rpc_pipefs /proc/mounts ; then
46 modprobe -s sunrpc >/dev/null 2>&1
47 run_cmd "Mounting /var/lib/nfs/rpc_pipefs filesystem" \
48 mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
49 fi
50
51 msg_starting "RPC idmapdd"
52 daemon rpc.idmapd $RPCIDMAPOPTIONS
53 RETVAL=$?
54 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/idmapd
55 else
56 msg_already_running "RPC idmapdd"
57 fi
58 ;;
59 stop)
60 if [ -f /var/lock/subsys/idmapd ]; then
61 msg_stopping "RPC idmapd"
62 killproc rpc.idmapd
63 rm -f /var/lock/subsys/idmapd
64 else
65 msg_not_running "RPC idmapd"
66 fi
67 ;;
68 status)
69 status rpc.idmapd
70 RETVAL=$?
71 ;;
72 restart|reload)
73 $0 stop
74 $0 start
75 RETVAL=$?
76 ;;
77 *)
78 msg_usage "$0 {start|stop|restart|status}"
79 exit 1
80esac
81
82exit $RETVAL
This page took 0.082085 seconds and 4 git commands to generate.