ia64/xen-unstable

changeset 16510:7bee812a0397

Fix xenmon.py to work on Solaris

The xenmon.py script does not work on Solaris because of (1) its
assumption that xenbaked is in the users path and, (2) the use of the
killall command. Changed xenmon.py to use pkill instead and provided
the path to xenbaked on Solaris.

Signed-off-by: Tariq Magdon-Ismail <tariqmi@sun.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Dec 04 10:40:48 2007 +0000 (2007-12-04)
parents 0e8e68cfc8ac
children d1e1db24bd5f
files tools/xenmon/xenmon.py
line diff
     1.1 --- a/tools/xenmon/xenmon.py	Tue Dec 04 10:29:00 2007 +0000
     1.2 +++ b/tools/xenmon/xenmon.py	Tue Dec 04 10:40:48 2007 +0000
     1.3 @@ -653,21 +653,36 @@ def writelog():
     1.4  # start xenbaked
     1.5  def start_xenbaked():
     1.6      global options
     1.7 -    
     1.8 -    os.system("killall -9 xenbaked")
     1.9 -    # assumes that xenbaked is in your path
    1.10 -    os.system("xenbaked --ms_per_sample=%d &" %
    1.11 +    global kill_cmd
    1.12 +    global xenbaked_cmd
    1.13 +
    1.14 +    os.system(kill_cmd)
    1.15 +    os.system(xenbaked_cmd + " --ms_per_sample=%d &" %
    1.16                options.mspersample)
    1.17      time.sleep(1)
    1.18  
    1.19  # stop xenbaked
    1.20  def stop_xenbaked():
    1.21 -    os.system("killall -s INT xenbaked")
    1.22 +    global stop_cmd
    1.23 +    os.system(stop_cmd)
    1.24  
    1.25  def main():
    1.26      global options
    1.27      global args
    1.28      global domains
    1.29 +    global stop_cmd
    1.30 +    global kill_cmd
    1.31 +    global xenbaked_cmd
    1.32 +
    1.33 +    if os.uname()[0] == "SunOS":
    1.34 +        xenbaked_cmd = "/usr/lib/xenbaked"
    1.35 +	stop_cmd = "/usr/bin/pkill -INT -z global xenbaked"
    1.36 +	kill_cmd = "/usr/bin/pkill -KILL -z global xenbaked"
    1.37 +    else:
    1.38 +        # assumes that xenbaked is in your path
    1.39 +        xenbaked_cmd = "xenbaked"
    1.40 +        stop_cmd = "/usr/bin/pkill -INT xenbaked"
    1.41 +        kill_cmd = "/usr/bin/pkill -KILL xenbaked"
    1.42  
    1.43      parser = setup_cmdline_parser()
    1.44      (options, args) = parser.parse_args()