Rush has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/305659

Change subject: labs: nfs manager add clean (all) and brief help
......................................................................

labs: nfs manager add clean (all) and brief help

Change-Id: Ide64b711a0b0ea729ecb0c5b63e17122e4ef6a16
---
M modules/labstore/files/nfs-mount-manager.sh
1 file changed, 25 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/59/305659/1

diff --git a/modules/labstore/files/nfs-mount-manager.sh 
b/modules/labstore/files/nfs-mount-manager.sh
index 8aebca6..32f636b 100644
--- a/modules/labstore/files/nfs-mount-manager.sh
+++ b/modules/labstore/files/nfs-mount-manager.sh
@@ -2,6 +2,20 @@
 
 set -e
 
+to_umount () {
+            # -f = force an unmount (in case of an unreachable NFS system).  \
+            # (Requires kernel 2.1.116 or later.)
+            #
+            # -l = Lazy  unmount.  Detach the filesystem from the file 
hierarchy now, \
+            # and clean up all references to this \
+            #  filesystem as soon as it is not busy anymore.
+            /usr/bin/timeout -k 10s 20s /bin/umount -fl $1
+
+            # While a mount path is not associated we don't
+            # want files being dumped their on local disk
+            /bin/chmod 600 $1
+}
+
 case "$1" in
         check)
 
@@ -26,17 +40,16 @@
 
             ;;
         umount)
-
-            # -f = force an unmount (in case of an unreachable NFS system).  \
-            # (Requires kernel 2.1.116 or later.)
-            #
-            # -l = Lazy  unmount.  Detach the filesystem from the file 
hierarchy now, \
-            # and clean up all references to this \
-            #  filesystem as soon as it is not busy anymore.
-            /usr/bin/timeout -k 10s 20s /bin/umount -fl $2
-
-            # While a mount path is not associated we don't
-            # want files being dumped their on local disk
-            /bin/chmod 600 $2
+            to_umount $2
+            ;;
+        clean)
+            # Remove all mounts
+            for m in `/bin/cat /proc/mounts | /bin/grep nfs4 | /usr/bin/awk 
'{print $3}'`; do
+                to_umount $m;
+            done
+            ;;
+        *)
+            echo 'status|mount|umount <mount_path>'
+            echo 'clean' -- remove all mounts
             ;;
 esac

-- 
To view, visit https://gerrit.wikimedia.org/r/305659
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ide64b711a0b0ea729ecb0c5b63e17122e4ef6a16
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Rush <r...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to