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

[Xen-changelog] [xen-unstable] [SOLARIS] Xen daemons are managed separately, so we need a way to start



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID a682d1be3f9589308af55f115090518a92aff7c4
# Parent  025e19453f1a032082f120c40d81ede69c9a4bb8
[SOLARIS] Xen daemons are managed separately, so we need a way to start
just xend, and we need to disable xend's self-restarter.

Signed-off-by: John Levon <john.levon@xxxxxxx>
---
 tools/misc/xend                           |   10 +++++++---
 tools/python/xen/xend/osdep.py            |   11 ++++++++++-
 tools/python/xen/xend/server/SrvDaemon.py |    9 ++++++++-
 3 files changed, 25 insertions(+), 5 deletions(-)

diff -r 025e19453f1a -r a682d1be3f95 tools/misc/xend
--- a/tools/misc/xend   Tue Oct 17 18:50:08 2006 +0100
+++ b/tools/misc/xend   Tue Oct 17 18:52:17 2006 +0100
@@ -19,6 +19,9 @@
 
    The daemon should reconnect to device control interfaces
    and recover its state when restarted.
+
+   On Solaris, the daemons are SMF managed, and you should not attempt
+   to start xend by hand.
 """
 import os
 import os.path
@@ -108,9 +111,10 @@ def main():
     if not sys.argv[1:]:
         print 'usage: %s {start|stop|restart}' % sys.argv[0]
     elif sys.argv[1] == 'start':
-        start_xenstored()
-        start_consoled()
-       start_blktapctrl()
+        if os.uname()[0] != "SunOS":
+            start_xenstored()
+            start_consoled()
+            start_blktapctrl()
         return daemon.start()
     elif sys.argv[1] == 'trace_start':
         start_xenstored()
diff -r 025e19453f1a -r a682d1be3f95 tools/python/xen/xend/osdep.py
--- a/tools/python/xen/xend/osdep.py    Tue Oct 17 18:50:08 2006 +0100
+++ b/tools/python/xen/xend/osdep.py    Tue Oct 17 18:52:17 2006 +0100
@@ -24,4 +24,13 @@ _scripts_dir = {
     "SunOS": "/usr/lib/xen/scripts",
 }
 
-scripts_dir = _scripts_dir.get(os.uname()[0], "/etc/xen/scripts")
+_xend_autorestart = {
+    "Linux": True,
+    "SunOS": False,
+}
+
+def _get(var, default=None):
+    return var.get(os.uname()[0], default)
+
+scripts_dir = _get(_scripts_dir, "/etc/xen/scripts")
+xend_autorestart = _get(_xend_autorestart)
diff -r 025e19453f1a -r a682d1be3f95 tools/python/xen/xend/server/SrvDaemon.py
--- a/tools/python/xen/xend/server/SrvDaemon.py Tue Oct 17 18:50:08 2006 +0100
+++ b/tools/python/xen/xend/server/SrvDaemon.py Tue Oct 17 18:52:17 2006 +0100
@@ -17,6 +17,7 @@ import xen.lowlevel.xc
 import xen.lowlevel.xc
 
 from xen.xend.XendLogging import log
+from xen.xend import osdep
 
 import relocate
 import SrvServer
@@ -168,8 +169,14 @@ class Daemon:
             # ready to receive requests.  All subsequent restarts we don't
             # want this behaviour, or the pipe will eventually fill up, so
             # we just pass None into run in subsequent cases (by clearing w
-            # in the parent of the first fork).
+            # in the parent of the first fork).  On some operating systems,
+            # restart is managed externally, so we won't fork, and just exit.
             while True:
+
+                if not osdep.xend_autorestart:
+                    self.run(os.fdopen(w, 'w'))
+                    break
+
                 pid = self.fork_pid()
                 if pid:
                     if w is not None:

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


 


Rackspace

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