X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=pl_mop.sh;h=0471513e003e5f87c193385787d78f96875c8afa;hb=86477888b3b0df8ce58cebb4a7ac0ce76b457da7;hp=61b7a6359d1f5bd189989d845f75d54aae637ab2;hpb=e9b522b95acd8712285078e91f2d5a79cfc7c913;p=mom.git diff --git a/pl_mop.sh b/pl_mop.sh index 61b7a63..0471513 100755 --- a/pl_mop.sh +++ b/pl_mop.sh @@ -5,7 +5,7 @@ # Mark Huang # Copyright (C) 2005 The Trustees of Princeton University # -# $Id: pl_mop.sh,v 1.6 2006/04/28 19:28:59 mlhuang Exp $ +# $Id$ # PATH=/sbin:/usr/sbin:$PATH @@ -53,7 +53,7 @@ fix_etc_shadow() { # keep essential services running restart_services() { - for service in sshd pl_sshd swapmon pl_nm proper ; do + for service in sshd pl_sshd swapmon nm proper ; do echo "* Checking $service" status=$(service $service status) if [ $? -ne 0 ] || echo $status 2>&1 | grep -q stopped ; then @@ -75,17 +75,6 @@ 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 stop - vserver pl_conf start - fi -} - # GPG keys are installed in /etc/pki/rpm-gpg by both the Boot Manager # during initial installation, and by PlanetLabConf during daily # updates. NodeUpdate imports the keys into the RPM database before @@ -214,18 +203,28 @@ kill_duplicate_ssh() { done } +kill_nm_inslice(){ + pids=$(vps aux | awk '$1 != "root" && $14 == "/usr/share/NodeManager/nm.py" {print $2}') + for pid in $pids ; do + line=$(vps aux | grep $pid) + echo Killing PID $pid + echo $line + kill -9 $pid + done +} + # XXX kill zombie slices # XXX reboot if boot state changes +run kill_nm_inslice + run fix_vservers run fix_etc_shadow run restart_services -run restart_pl_conf - run restart_netflow run kill_duplicate_ssh