# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2005 The Trustees of Princeton University
#
-# $Id$
+# $Id: pl_mop.sh,v 1.1 2005/10/11 17:34:57 mlhuang Exp $
#
PATH=/sbin:/usr/sbin:$PATH
# keep essential services running
restart_services() {
- for service in autofs sshd pl_sshd pl_mom pl_nm pl_conf proper ; do
+ for service in autofs sshd pl_sshd pl_mom pl_nm proper ; do
echo "* Checking $service"
status=$(service $service status)
if [ $? -ne 0 ] || echo $status 2>&1 | grep -q stopped ; then
fi
}
+# keep pl_conf running
+restart_pl_conf() {
+ echo "* Checking 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
+ fi
+}
+
# kill all the processes running in slice contexts
vkillall() {
vps -A | awk '(int($2) > 1) { system("vkill -c " $2 " -s 9 " $1); }'
run restart_services
+run restart_pl_conf
+
run restart_netflow
run kill_duplicate_ssh