[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-users] Locking Console: A simple little script


  • To: xen-users <xen-users@xxxxxxxxxxxxxxxxxxx>
  • From: Steve Spencer <sspencer@xxxxxxxx>
  • Date: Wed, 26 Nov 2008 07:15:30 -0600
  • Delivery-date: Wed, 26 Nov 2008 05:15:41 -0800
  • List-id: Xen user discussion <xen-users.lists.xensource.com>

All,

A few people have reported this problem over time:  A machine that has
been up for awhile, you execute the console for a DomU and you type a
few characters and the system becomes unresponsive.  Everything on the
DomU is working, but you can't use the console.  The only way to fix
this is to find the running process id for the xenconsoled and kill it
and then restart the console.  The below script, written specifically
for a CentOS5.x Dom0, handles and simplifies this process.

On my machines, I've named this xencond, but it could obviously be named
anything you like.  I put it in /etc/rc.d/init.d/ as with all red-hat
ish scripts.  I can't take credit for the PGM (variable used in case the
script is renamed for some reason in the future)  or the reg expression
manipulation (done by a programmer here to remove the leading spaces on
a PID).  There is also no need for the echo line for nuke_id.  This was
put in for debugging purposes, and lazily I just haven't removed it.

If any of you find it useful, great.  If not, that's fine too:

script:

 #!/bin/bash

PGM=`basename $0`

# script to restart the xenconsole daemon
if [ "$1" = "" ]
then
        clear
        echo "###########################################################"
        echo "#                                                         #"
        echo "# Usage /etc/rc.d/init.d/$PGM restart   #"
        echo "#                                                         #"
        echo "###########################################################"
elif [ "$1" != "restart" ]
then
        echo "## just 'restart' is valid, sorry ##"
elif [ "$1" = "restart" ]
then
        nuke_id=`ps ax | grep xenconsoled | grep -v grep | sed -e "s/^ \+//" |
cut -d" " -f1`
        echo $nuke_id
        echo ...stopping xenconsole
        kill $nuke_id
        echo ...starting xenconsole
        /usr/sbin/xenconsoled
fi

Thanks,
-- 
Steven G. Spencer, Network Administrator
KSC Corporate - The Kelly Supply Family of Companies
Office 308-382-8764 Ext. 231
Mobile 308-380-7957

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.