From: Mark Huang Date: Thu, 3 Nov 2005 17:23:44 +0000 (+0000) Subject: - fix how pl_conf is checked and restarted X-Git-Tag: planetlab-3_3-branch-point~32 X-Git-Url: http://git.onelab.eu/?p=mom.git;a=commitdiff_plain;h=e8cb9b16d0a8fe295ceca3d66b6c91e054c59e4c - fix how pl_conf is checked and restarted --- diff --git a/pl_mom.spec b/pl_mom.spec index 7b6e8b2..0738135 100644 --- a/pl_mom.spec +++ b/pl_mom.spec @@ -1,6 +1,6 @@ %define name pl_mom %define version 0.3 -%define release 10.planetlab%{?date:.%{date}} +%define release 11.planetlab%{?date:.%{date}} Summary: PlanetLab mom -- Cleans up your mess Name: %{name} diff --git a/pl_mop.sh b/pl_mop.sh index d80ce64..ab6c50f 100755 --- a/pl_mop.sh +++ b/pl_mop.sh @@ -5,7 +5,7 @@ # Mark Huang # 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 @@ -46,7 +46,7 @@ fix_etc_shadow() { # 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 @@ -68,6 +68,16 @@ restart_netflow() { 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); }' @@ -168,6 +178,8 @@ run fix_etc_shadow run restart_services +run restart_pl_conf + run restart_netflow run kill_duplicate_ssh