Author: baggins Date: Mon Mar 5 12:58:44 2012 GMT Module: packages Tag: HEAD ---- Log message: - we want to manage xend ourselves
---- Files affected: packages/xen: xen.spec (1.104 -> 1.105) , xend.init (1.3 -> 1.4) , xen-initscript.patch (NONE -> 1.1) (NEW) ---- Diffs: ================================================================ Index: packages/xen/xen.spec diff -u packages/xen/xen.spec:1.104 packages/xen/xen.spec:1.105 --- packages/xen/xen.spec:1.104 Mon Mar 5 00:56:17 2012 +++ packages/xen/xen.spec Mon Mar 5 13:58:39 2012 @@ -9,7 +9,7 @@ Summary(pl.UTF-8): Xen - monitor maszyny wirtualnej Name: xen Version: 4.1.2 -Release: 0.3 +Release: 0.6 License: GPL Group: Applications/System Source0: http://bits.xensource.com/oss-xen/release/%{version}/%{name}-%{version}.tar.gz @@ -61,6 +61,7 @@ Patch11: xen-dumpdir.patch Patch12: xen-net-disable-iptables-on-bridge.patch Patch13: xen-configure-xend.patch +Patch14: xen-initscript.patch # stubdom patch Patch100: grub-ext4-support.patch URL: http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html @@ -217,6 +218,7 @@ %patch11 -p1 %patch12 -p1 %patch13 -p1 +%patch14 -p1 %{__rm} -v tools/check/*.orig @@ -452,6 +454,9 @@ All persons listed below can be reached at <cvs_login>@pld-linux.org $Log$ +Revision 1.105 2012/03/05 12:58:39 baggins +- we want to manage xend ourselves + Revision 1.104 2012/03/04 23:56:17 baggins - xz compression for domU kernels from upstream ================================================================ Index: packages/xen/xend.init diff -u packages/xen/xend.init:1.3 packages/xen/xend.init:1.4 --- packages/xen/xend.init:1.3 Mon Mar 5 00:30:00 2012 +++ packages/xen/xend.init Mon Mar 5 13:58:39 2012 @@ -20,18 +20,6 @@ # Source function library. . /etc/rc.d/init.d/functions -waitfordaemon() { - i=1 - rets=10 - /usr/sbin/xend status - while [ $? -ne 0 -a $i -lt $rets ]; do - sleep 1 - i=$(($i + 1)) - /usr/sbin/xend status - done - return $? -} - start() { if [ -f /var/lock/subsys/xend ]; then msg_already_running "Xen control daemon" @@ -41,17 +29,10 @@ echo "xenconsoled and xenstored must be started first" return fi - show "Starting Xen control daemon" - busy - /usr/sbin/xend start - waitfordaemon + msg_starting "Starting Xen control daemon" + daemon /usr/sbin/xend RETVAL=$? - if [ $RETVAL -eq 0 ]; then - touch /var/lock/subsys/xend - ok - else - fail - fi + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/xend } stop() { @@ -59,38 +40,29 @@ msg_not_running "Xen control daemon" return fi - show "Stopping Xen control daemon" - busy - /usr/sbin/xend stop - ok + msg_stopping "Stopping Xen control daemon" + killproc xend rm -f /var/lock/subsys/xend } reload() { if [ ! -f /var/lock/subsys/xend ]; then msg_not_running "Xen control daemon" - return + RETVAL=7 + else + msg_reloading "Reloading Xen control daemon" + killproc /usr/sbin/xend -HUP + RETVAL=$? fi - show "Reloading Xen control daemon" - busy - /usr/sbin/xend reload - ok } -restart() { +condrestart() { if [ ! -f /var/lock/subsys/xend ]; then msg_not_running "Xen control daemon" - return - fi - show "Restarting Xen control daemon" - busy - /usr/sbin/xend restart - waitfordaemon - RETVAL=$? - if [ $RETVAL -eq 0 ]; then - ok + RETVAL=$1 else - fail + stop + start fi } @@ -103,17 +75,22 @@ stop) stop ;; - status) - /usr/sbin/xend status + restart) + stop + start + ;; + try-restart) + condrestart 0 ;; - reload) + reload|force-reload) reload ;; - restart|force-reload) - restart + status) + status xend + exit $? ;; *) - msg_usage "$0 {start|stop|status|restart|reload|force-reload}" + msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}" exit 3 esac ================================================================ Index: packages/xen/xen-initscript.patch diff -u /dev/null packages/xen/xen-initscript.patch:1.1 --- /dev/null Mon Mar 5 13:58:45 2012 +++ packages/xen/xen-initscript.patch Mon Mar 5 13:58:39 2012 @@ -0,0 +1,138 @@ +--- xen-4.1.0/tools/misc/xend.orig 2010-02-02 20:43:01.000000000 +0000 ++++ xen-4.1.0/tools/misc/xend 2010-02-02 21:16:13.000000000 +0000 +@@ -8,103 +8,16 @@ + """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 +- + 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 start_daemon(daemon, *args): +- if os.fork() == 0: +- os.execvp(daemon, (daemon,) + args) +- +-def start_blktapctrl(): +- start_daemon("blktapctrl", "") +- + 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': +- if os.uname()[0] != "SunOS": +- start_blktapctrl() +- return daemon.start() +- elif sys.argv[1] == 'trace_start': +- start_blktapctrl() +- 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': +- start_blktapctrl() +- return daemon.stop() or daemon.start() +- elif sys.argv[1] == 'status': +- return daemon.status() +- else: +- print 'not an option:', sys.argv[1] +- return 1 ++ return daemon.start() + + if __name__ == '__main__': + sys.exit(main()) +diff -up xen-3.4.0/tools/python/xen/xend/osdep.py.fix xen-3.4.0/tools/python/xen/xend/osdep.py +--- xen-3.4.0/tools/python/xen/xend/osdep.py.fix 2009-05-18 13:05:38.000000000 +0200 ++++ xen-3.4.0/tools/python/xen/xend/osdep.py 2009-05-20 15:39:18.000000000 +0200 +@@ -27,7 +27,7 @@ _scripts_dir = { + + _xend_autorestart = { + "NetBSD": True, +- "Linux": True, ++ "Linux": False, + "SunOS": False, + } + +diff -up xen-3.4.0/tools/python/xen/xend/server/SrvDaemon.py.fix xen-3.4.0/tools/python/xen/xend/server/SrvDaemon.py +--- xen-3.4.0/tools/python/xen/xend/server/SrvDaemon.py.fix 2009-05-18 13:05:38.000000000 +0200 ++++ xen-3.4.0/tools/python/xen/xend/server/SrvDaemon.py 2009-05-20 15:39:18.000000000 +0200 +@@ -110,7 +110,14 @@ class Daemon: + # Fork, this allows the group leader to exit, + # which means the child can never again regain control of the + # terminal +- if os.fork(): ++ child = os.fork() ++ if child: ++ if not osdep.xend_autorestart: ++ pidfile = open(XEND_PID_FILE, 'w') ++ try: ++ pidfile.write(str(child)) ++ finally: ++ pidfile.close() + os._exit(0) + + # Detach from standard file descriptors, and redirect them to ================================================================ ---- CVS-web: http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/xen/xen.spec?r1=1.104&r2=1.105&f=u http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/xen/xend.init?r1=1.3&r2=1.4&f=u _______________________________________________ pld-cvs-commit mailing list [email protected] http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit
