]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
- generic check_portmapper function
authorJan Rękorajski <baggins@pld-linux.org>
Thu, 26 Apr 2007 14:55:36 +0000 (14:55 +0000)
committerJan Rękorajski <baggins@pld-linux.org>
Thu, 26 Apr 2007 14:55:36 +0000 (14:55 +0000)
svn-id: @8470

rc.d/init.d/functions

index c7ff4049c3b8c6cb217616bb71c4a4c586c18c6f..97091b94e99dd47c8e01f9a87bbdc537f51ed154 100644 (file)
@@ -878,6 +878,22 @@ clean_vserver_mtab() {
        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,
This page took 0.049171 seconds and 4 git commands to generate.