WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Fix xenmon.py to work on Solaris
From: john.levon@xxxxxxx
Date: Thu, 29 Nov 2007 14:15:20 -0800
Delivery-date: Thu, 29 Nov 2007 14:16:05 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Fix xenmon.py to work on Solaris, john . levon <=