SVN: rc-scripts/trunk/rc.d/init.d/functions

baggins baggins at pld-linux.org
Thu Apr 26 16:55:39 CEST 2007


Author: baggins
Date: Thu Apr 26 16:55:36 2007
New Revision: 8470

Modified:
   rc-scripts/trunk/rc.d/init.d/functions
Log:
- generic check_portmapper function


Modified: rc-scripts/trunk/rc.d/init.d/functions
==============================================================================
--- rc-scripts/trunk/rc.d/init.d/functions	(original)
+++ rc-scripts/trunk/rc.d/init.d/functions	Thu Apr 26 16:55:36 2007
@@ -878,6 +878,22 @@
 	mv -f /etc/mtab.clean /etc/mtab
 }
 
+# Check if any flavor of portmapper is running
+check_portmapper() {
+	RPCINFO=$(which rpcinfo)
+	if [ -x "$RPCINFO" ]; then
+		if $RPCINFO -p localhost >/dev/null 2>/dev/null ; then
+			return 0 
+		else
+			return 1
+		fi
+	elif [ -x /sbin/pidof ]; then
+		[ -z "`/sbin/pidof portmap`" -a \
+		  -z "`/sbin/pidof rpcbind`" ] && return 1
+	fi
+	return 0
+}
+
 rc_cache_init() {
 	# If we have cachefile, use it.
 	# If we don't, create memory variables and try to save silently,


More information about the pld-cvs-commit mailing list