SOURCES: rpcbind.sysconfig (NEW), rpcbind.init (NEW) - init script...

baggins baggins at pld-linux.org
Tue Apr 24 17:09:27 CEST 2007


Author: baggins                      Date: Tue Apr 24 15:09:27 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- init scripts for rpcbind (portmap replacement)

---- Files affected:
SOURCES:
   rpcbind.sysconfig (NONE -> 1.1)  (NEW), rpcbind.init (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/rpcbind.sysconfig
diff -u /dev/null SOURCES/rpcbind.sysconfig:1.1
--- /dev/null	Tue Apr 24 17:09:27 2007
+++ SOURCES/rpcbind.sysconfig	Tue Apr 24 17:09:22 2007
@@ -0,0 +1,14 @@
+# Set nice level for rpcbind
+SERVICE_RUN_NICE_LEVEL="+1"
+
+# Cause rpcbind to change to the user rpc as soon as possible
+RPCBIND_RPCUSER="yes"
+
+# Turn on libwrap connection logging
+RPCBIND_VERBOSE="yes"
+
+# "Insecure" mode.  Allow calls to SET and UNSET from any host
+RPCBIND_INSECURE="no"
+
+# Specify specific IP addresses to bind to for UDP requests
+#RPCBIND_ADDRESSES="10.1.0.1"

================================================================
Index: SOURCES/rpcbind.init
diff -u /dev/null SOURCES/rpcbind.init:1.1
--- /dev/null	Tue Apr 24 17:09:27 2007
+++ SOURCES/rpcbind.init	Tue Apr 24 17:09:22 2007
@@ -0,0 +1,91 @@
+#!/bin/sh
+#
+# rpcbind	Start/Stop RPC universal addresses to RPC program number mapper
+#
+# chkconfig:	345 11 89
+#
+# description:	The rpcbind utility is a server that converts RPC program \
+#		numbers into universal addresses.  It must be running on \
+#		the host to be able to make RPC calls on a server on that \
+#		machine.
+# processname:	rpcbind
+
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Get service config
+[ -f /etc/sysconfig/rpcbind ] && . /etc/sysconfig/rpcbind
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+	if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+		msg_network_down rpcbind
+		exit 1
+	fi
+else
+	exit 0
+fi
+
+start() {
+	# Check if the service is already running?
+	if [ ! -f /var/lock/subsys/rpcbind ]; then
+		is_no "${RPCBIND_RPCUSER}" || RPCBIND_OPTIONS="${RPCBIND_OPTIONS} -s"
+		is_no "${RPCBIND_VERBOSE}" || RPCBIND_OPTIONS="${RPCBIND_OPTIONS} -l"
+		is_yes "${RPCBIND_INSECURE}" && RPCBIND_OPTIONS="${RPCBIND_OPTIONS} -i"
+		[ -z "${RPCBIND_ADDRESSES}" ] || \
+			for a in $RPCBIND_ADDRESSES ; do
+				RPCBIND_OPTIONS="${RPCBIND_OPTIONS} -h $a"
+			done
+		msg_starting rpcbind
+		daemon rpcbind ${RPCBIND_OPTIONS}
+		RETVAL=$?
+		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/rpcbind
+	else
+		msg_already_running rpcbind
+	fi
+}
+
+stop() {
+	if [ -f /var/lock/subsys/rpcbind ]; then
+		msg_stopping rpcbind
+		killproc rpcbind
+		rm -f /var/lock/subsys/rpcbind
+	else
+		msg_not_running rpcbind
+	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+	RPCBIND_OPTIONS=
+  	start
+	;;
+  stop)
+  	stop
+	;;
+  cleanup)
+	stop
+	RPCBIND_OPTIONS=
+	start
+	;;
+  restart|force-reload)
+	stop
+	RPCBIND_OPTIONS="-w"
+	start
+	;;
+  status)
+	status rpcbind
+	exit $?
+	;;
+  *)
+	msg_usage "$0 {start|stop|restart|force-reload|cleanup|status}"
+	exit 3
+esac
+
+exit $RETVAL
================================================================


More information about the pld-cvs-commit mailing list