add stupid test program that leaks memory at a configurable rate
[mom.git] / pl_mop.sh
index 2fca18b..edc8222 100755 (executable)
--- a/pl_mop.sh
+++ b/pl_mop.sh
@@ -5,7 +5,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2005 The Trustees of Princeton University
 #
-# $Id: pl_mop.sh,v 1.2 2005/11/03 17:23:25 mlhuang Exp $
+# $Id: pl_mop.sh,v 1.5 2006/03/06 20:40:33 mlhuang Exp $
 #
 
 PATH=/sbin:/usr/sbin:$PATH
@@ -46,7 +46,7 @@ fix_etc_shadow() {
 
 # keep essential services running
 restart_services() {
-    for service in sshd pl_sshd pl_mom pl_nm proper ; do
+    for service in sshd pl_sshd swapmon pl_nm proper ; do
        echo "* Checking $service"
        status=$(service $service status)
        if [ $? -ne 0 ] || echo $status 2>&1 | grep -q stopped ; then
@@ -74,7 +74,8 @@ restart_pl_conf() {
     vserver pl_conf exec /sbin/service pl_conf status >/dev/null 2>&1
     if [ $? -ne 0 ] ; then
        echo "* Restarting pl_conf"
-       vserver pl_conf restart
+       vserver pl_conf stop
+       vserver pl_conf start
     fi
 }
 
@@ -128,8 +129,11 @@ fix_vservers() {
         # blow away the vserver cache
        rm -rf /vservers/.vcache/*
 
-        # re-mount /vservers
-       mount /vservers
+        # XXX re-mount /vservers
+       # mount /vservers
+
+       # shutdown instead to avoid clearing disk quotas
+       shutdown -r now "/vservers filesystem repaired, rebooting"
     else
        echo "Unable to unmount /vservers!" >&2
     fi