diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-06-07 15:49:46 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-06-07 15:49:46 +0100 |
commit | 702890192a4c1f05aabb24332bec2721fb75399e (patch) | |
tree | be41e2b7858c6483d253dc7505744487ace32768 /tools/misc | |
parent | 9bb88be5420e9c804be52cfb597260672f41cc04 (diff) | |
download | xen-702890192a4c1f05aabb24332bec2721fb75399e.tar.gz xen-702890192a4c1f05aabb24332bec2721fb75399e.tar.bz2 xen-702890192a4c1f05aabb24332bec2721fb75399e.zip |
xl: init scripts (v2)
Now the init script is called xencommons and, as the name suggests, it
is a common script between xl and xend because it is used to start
xenconsoled, xenstored and xenbackendd and the initialization of these
three daemons has been removed from xend. The global
xen_toolstack=xl/xend variable has been removed. Regarding the
network setup, I made the vif scripts follow the same pattern as the
other scripts in xen-backend: a new script called vif-setup is
executed unconditionally. vif-setup is going to do the right thing
depending on the value of the environmental variable "script" (same
technique used before), defaulting to vif-bridge. In the common
scenario the toolstack doesn't need to set the variable "script"
because vif-bridge is going to be called anyway. There is no global
network script to setup the network bridges with xl, so if you are
using xl without xend, you need to manually configure the bridges
using your distro network setup, or, if you are lazy, you can just add
something like:
/etc/xen/scripts/network-bridge start
to your rc.local.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Diffstat (limited to 'tools/misc')
-rw-r--r-- | tools/misc/xend | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/tools/misc/xend b/tools/misc/xend index f33e35bf24..9ef021054c 100644 --- a/tools/misc/xend +++ b/tools/misc/xend @@ -73,48 +73,9 @@ def start_daemon(daemon, *args): if os.fork() == 0: os.execvp(daemon, (daemon,) + args) -def start_xenstored(): - pidfname = "/var/run/xenstore.pid" - try: - f = open(pidfname, "a") - try: - fcntl.lockf(f, fcntl.LOCK_EX | fcntl.LOCK_NB) - rootdir = os.getenv("XENSTORED_ROOTDIR") or "/var/lib/xenstored" - for i in glob.glob(rootdir + "/tdb*"): - try: - os.unlink(i) - except: - pass - os.unlink(pidfname) - except: - pass - f.close() - except: - pass - XENSTORED_TRACE = os.getenv("XENSTORED_TRACE") - cmd = "xenstored --pid-file /var/run/xenstore.pid" - if XENSTORED_TRACE: - cmd += " -T /var/log/xen/xenstored-trace.log" - s,o = commands.getstatusoutput(cmd) - -def start_consoled(): - XENCONSOLED_TRACE = os.getenv("XENCONSOLED_TRACE") - args = "" - if XENCONSOLED_TRACE: - args += "--log=" + XENCONSOLED_TRACE - start_daemon("xenconsoled", args) - def start_blktapctrl(): start_daemon("blktapctrl", "") -def start_xenbackendd(): - XENBACKENDD_DEBUG = os.getenv("XENBACKENDD_DEBUG") - args = "" - if XENBACKENDD_DEBUG: - args += "-d" - if os.uname()[0] == 'NetBSD': - start_daemon("xenbackendd", args) - def main(): try: check_logging() @@ -127,15 +88,9 @@ def main(): print 'usage: %s {start|stop|reload|restart}' % sys.argv[0] elif sys.argv[1] == 'start': if os.uname()[0] != "SunOS": - start_xenstored() - start_consoled() - start_xenbackendd() start_blktapctrl() return daemon.start() elif sys.argv[1] == 'trace_start': - start_xenstored() - start_consoled() - start_xenbackendd() start_blktapctrl() return daemon.start(trace=1) elif sys.argv[1] == 'stop': @@ -143,9 +98,6 @@ def main(): elif sys.argv[1] == 'reload': return daemon.reloadConfig() elif sys.argv[1] == 'restart': - start_xenstored() - start_consoled() - start_xenbackendd() start_blktapctrl() return daemon.stop() or daemon.start() elif sys.argv[1] == 'status': |