Author: glen
Date: Wed May  9 22:40:15 2007
New Revision: 8500

Modified:
   rc-scripts/trunk/rc.d/init.d/functions
Log:
- keep /etc/mtab permissions (whatever they are) inside vserver
- which outputs to stderr if it can't find the program

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      Wed May  9 22:40:15 2007
@@ -916,21 +916,22 @@
 # Remove duplicate entries from mtab (for vserver guest use only)
 clean_vserver_mtab() {
        :>/etc/mtab.clean
-       cat /etc/mtab | while read device mountpoint line ; do
+       while read device mountpoint line; do
                grep -qs "$mountpoint" /etc/mtab.clean || \
                        echo "$device $mountpoint $line" >> /etc/mtab.clean
-       done
-       mv -f /etc/mtab.clean /etc/mtab
+       done < /etc/mtab
+       cat /etc/mtab.clean > /etc/mtab
+       rm -f /etc/mtab.clean
 }
 
 # Check if any flavor of portmapper is running
 check_portmapper() {
        typeset RPCINFO
 
-       RPCINFO=$(which rpcinfo)
+       RPCINFO=$(which rpcinfo 2>/dev/null)
        if [ -x "$RPCINFO" ]; then
-               if $RPCINFO -p localhost >/dev/null 2>/dev/null ; then
-                       return 0 
+               if $RPCINFO -p localhost >/dev/null 2>/dev/null; then
+                       return 0
                else
                        return 1
                fi
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to