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

[Xen-devel] [PATCH] Fix xenmon.py to work on Solaris



# HG changeset patch
# User john.levon@xxxxxxx
# Date 1196374518 28800
# Node ID 7c85833b8e50cbc870d1ab49096cf2c6d91f4b0b
# Parent  ecf09d684264a43769a83fc3126d4f7587fa2719
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@xxxxxxx>

diff --git a/tools/xenmon/xenmon.py b/tools/xenmon/xenmon.py
--- a/tools/xenmon/xenmon.py
+++ b/tools/xenmon/xenmon.py
@@ -653,21 +653,36 @@ def writelog():
 # start xenbaked
 def start_xenbaked():
     global options
-    
-    os.system("killall -9 xenbaked")
-    # assumes that xenbaked is in your path
-    os.system("xenbaked --ms_per_sample=%d &" %
+    global kill_cmd
+    global xenbaked_cmd
+
+    os.system(kill_cmd)
+    os.system(xenbaked_cmd + " --ms_per_sample=%d &" %
               options.mspersample)
     time.sleep(1)
 
 # stop xenbaked
 def stop_xenbaked():
-    os.system("killall -s INT xenbaked")
+    global stop_cmd
+    os.system(stop_cmd)
 
 def main():
     global options
     global args
     global domains
+    global stop_cmd
+    global kill_cmd
+    global xenbaked_cmd
+
+    if os.uname()[0] == "SunOS":
+        xenbaked_cmd = "/usr/lib/xenbaked"
+       stop_cmd = "/usr/bin/pkill -INT -z global xenbaked"
+       kill_cmd = "/usr/bin/pkill -KILL -z global xenbaked"
+    else:
+        # assumes that xenbaked is in your path
+        xenbaked_cmd = "xenbaked"
+        stop_cmd = "/usr/bin/pkill -INT xenbaked"
+        kill_cmd = "/usr/bin/pkill -KILL xenbaked"
 
     parser = setup_cmdline_parser()
     (options, args) = parser.parse_args()

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


 


Rackspace

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