/usr/lib/xen-4.4/bin/xend is in xen-utils-4.4 4.4.0-0ubuntu5.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | #! /usr/bin/python
# -*- mode: python; -*-
#============================================================================
# Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
# Copyright (C) 2005-2006 XenSource Inc
#============================================================================
"""Xen management daemon.
Provides console server and HTTP management api.
Run:
xend start
Restart:
xend restart
The daemon is stopped with:
xend stop
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 fcntl
import glob
import os
import os.path
import sys
import socket
import signal
import time
import commands
sys.path.insert(1, sys.path[0] + '/../lib/python')
from xen.xend.server import SrvDaemon
class CheckError(ValueError):
pass
def hline():
print >>sys.stderr, "*" * 70
def msg(message):
print >>sys.stderr, "*" * 3, message
def check_logging():
"""Check python logging is installed and raise an error if not.
Logging is standard from Python 2.3 on.
"""
try:
import logging
except ImportError:
hline()
msg("Python logging is not installed.")
msg("Use 'make install-logging' at the xen root to install.")
msg("")
msg("Alternatively download and install from")
msg("http://www.red-dove.com/python_logging.html")
hline()
raise CheckError("logging is not installed")
def check_user():
"""Check that the effective user id is 0 (root).
"""
if os.geteuid() != 0:
hline()
msg("Xend must be run as root.")
hline()
raise CheckError("invalid user")
def main():
try:
check_logging()
check_user()
except CheckError:
sys.exit(1)
daemon = SrvDaemon.instance()
if not sys.argv[1:]:
print 'usage: %s {start|stop|reload|restart}' % sys.argv[0]
elif sys.argv[1] == 'start':
return daemon.start()
elif sys.argv[1] == 'trace_start':
return daemon.start(trace=1)
elif sys.argv[1] == 'stop':
return daemon.stop()
elif sys.argv[1] == 'reload':
return daemon.reloadConfig()
elif sys.argv[1] == 'restart':
return daemon.stop() or daemon.start()
elif sys.argv[1] == 'status':
return daemon.status()
else:
print 'not an option:', sys.argv[1]
return 1
if __name__ == '__main__':
sys.exit(main())
|