Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Sep 2012 14:21:21 +0000 (UTC)
From:      Steve Wills <swills@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r304398 - in head/sysutils/xen-tools: . files
Message-ID:  <201209171421.q8HELL5B034492@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: swills
Date: Mon Sep 17 14:21:21 2012
New Revision: 304398
URL: http://svn.freebsd.org/changeset/ports/304398

Log:
  - Update to 4.1.3
  
  Added scripts so users of XCP and XenServer can finally use all Xen functionality.
  This includes:
  
  * Live migration
  * Suspend/resume
  * Reporting of memory usage
  * Reporting of network interfaces and IPs
  * Memory ballooning
  * Graceful Shutdown/Reboot
  
  PR:		ports/171646
  Submitted by:	Mark Felder <feld@feld.me> (maintainer)

Added:
  head/sysutils/xen-tools/files/xe-daemon.in   (contents, props changed)
  head/sysutils/xen-tools/files/xe_wrapper   (contents, props changed)
Modified:
  head/sysutils/xen-tools/Makefile
  head/sysutils/xen-tools/distinfo   (contents, props changed)

Modified: head/sysutils/xen-tools/Makefile
==============================================================================
--- head/sysutils/xen-tools/Makefile	Mon Sep 17 13:10:47 2012	(r304397)
+++ head/sysutils/xen-tools/Makefile	Mon Sep 17 14:21:21 2012	(r304398)
@@ -5,14 +5,23 @@
 # $FreeBSD$
 
 PORTNAME=	xen-tools
-PORTVERSION=	4.0.1
+PORTVERSION=	4.1.3
 CATEGORIES=	sysutils
 DISTNAME=	xen-${PORTVERSION}
 
 MAINTAINER=	feld@feld.me
 COMMENT=	Xen tools within FreeBSD domU
 
-MASTER_SITES=	http://bits.xensource.com/oss-xen/release/${PORTVERSION}/
+MASTER_SITES=	http://bits.xensource.com/oss-xen/release/${PORTVERSION}/:xensource \
+		https://github.com/${GIT_ACCOUNT}/${GIT_PROJECT}/tarball/${GIT_VERSION}/:github
+DISTFILES=	xen-${PORTVERSION}.tar.gz:xensource \
+		${GIT_ACCOUNT}-${GIT_PROJECT}-${GIT_VERSION}.tar.gz:github
+
+FETCH_ARGS=	-pRr
+GIT_ACCOUNT=	felderado
+GIT_PROJECT=	freebsd-xen-tools-scripts
+GIT_VERSION=	bfb06da
+GITSRC=		${WRKDIR}/${GIT_ACCOUNT}-${GIT_PROJECT}-${GIT_VERSION}/src/
 
 USE_GMAKE=	yes
 USE_PYTHON=	yes
@@ -30,7 +39,11 @@ PLIST_FILES=	lib/libxenstore.so.3.0 \
 		bin/xenstore-ls \
 		bin/xenstore-read \
 		bin/xenstore-rm \
-		bin/xenstore-write
+		bin/xenstore-write \
+		sbin/xe-daemon \
+		sbin/xe-update-guest-attrs \
+		sbin/xe_wrapper
+
 do-build:
 	cd ${WRKSRC}/tools && ${GMAKE} -C include
 	cd ${WRKSRC}/tools/misc && ${GMAKE} xen-detect
@@ -41,6 +54,9 @@ do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/tools/xenstore/xenstore ${PREFIX}/bin
 	${INSTALL_PROGRAM} ${WRKSRC}/tools/xenstore/xenstore-control ${PREFIX}/bin
 	${INSTALL_PROGRAM} ${WRKSRC}/tools/xenstore/libxenstore.so.3.0 ${PREFIX}/lib
+	${INSTALL_SCRIPT} ${GITSRC}/usr/local/sbin/xe-daemon ${PREFIX}/sbin
+	${INSTALL_SCRIPT} ${GITSRC}/usr/local/sbin/xe-update-guest-attrs ${PREFIX}/sbin
+	${INSTALL_SCRIPT} ${FILESDIR}/xe_wrapper ${PREFIX}/sbin
 
 post-install:
 	${LN} -sf ${PREFIX}/bin/xenstore ${PREFIX}/bin/xenstore-chmod

Modified: head/sysutils/xen-tools/distinfo
==============================================================================
--- head/sysutils/xen-tools/distinfo	Mon Sep 17 13:10:47 2012	(r304397)
+++ head/sysutils/xen-tools/distinfo	Mon Sep 17 14:21:21 2012	(r304398)
@@ -1,2 +1,4 @@
-SHA256 (xen-4.0.1.tar.gz) = 6e6d1d29400db93cb8095e034138aa8748b1bd4cffb4d3fd07af4ba15c918873
-SIZE (xen-4.0.1.tar.gz) = 11909200
+SHA256 (xen-4.1.3.tar.gz) = 178ef186aca2490126aef69ceb41fc509baf89e0d582768cfa33b17fd145c0e4
+SIZE (xen-4.1.3.tar.gz) = 10382132
+SHA256 (felderado-freebsd-xen-tools-scripts-bfb06da.tar.gz) = 58b5c5bb51bccb6843506bbb9c8ce3381ff262e6b221577496468f48226ab038
+SIZE (felderado-freebsd-xen-tools-scripts-bfb06da.tar.gz) = 50775

Added: head/sysutils/xen-tools/files/xe-daemon.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/xen-tools/files/xe-daemon.in	Mon Sep 17 14:21:21 2012	(r304398)
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# PROVIDE: xe_daemon
+# REQUIRE: login
+# KEYWORD: nojail shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# xe_daemon_enable (bool): Set to NO by default.
+#       Set it to YES to enable xe_daemon.
+#
+
+. /etc/rc.subr
+
+name=xe_daemon
+rcvar=xe_daemon_enable
+
+command="%%PREFIX%%/sbin/xe_wrapper"
+command_interpreter="/bin/sh -T"
+command_args="%%PREFIX%%/sbin/xe-daemon &"
+
+load_rc_config $name
+
+pidfile="/var/run/xe_wrapper.pid"
+: ${xe_daemon_enable="NO"}
+
+run_rc_command "$1"

Added: head/sysutils/xen-tools/files/xe_wrapper
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/xen-tools/files/xe_wrapper	Mon Sep 17 14:21:21 2012	(r304398)
@@ -0,0 +1,91 @@
+#!/bin/sh -T
+#
+#-
+# Copyright 2009 Thomas-Martin Seck. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted providing that the following conditions 
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 
+# THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+#
+# socat_wrapper socat [options]
+#
+# A simple wrapper script for socat (or any other program that does not
+# daemonize itself and logs to stdout).
+# 
+# This wrapper tries to emulate part of the functionality usually supplied by
+# software like daemontools or runit. It can be used by a FreeBSD port rc.d
+# script to start a program that does not daemonize itself and logs to
+# stdout/stderr. It redirects stdout and stderr to logger(1) via a fifo.
+# 
+# Note: We need a shell that can offer us asynchronous trap handling in order
+# to be able to abort the infinite loop from outside. FreeBSD's /bin/sh offers
+# the "-T" switch for this purpose.
+# 
+# TODO: send fd 2 output to never-never land to get rid of "Terminated" when we
+# kill this script but provide a way for errx() to communicate with the outside
+# world via stderr.
+#
+
+errx() {
+	echo "${me}: $@" >&2
+	exit 1
+}
+
+cleanup() {
+	rm -rf ${tmpdir}
+	rm -f ${pidfile}
+}
+
+PATH=/bin:/sbin:/usr/bin:/usr/sbin
+
+me=${0##*/}
+logger=/usr/bin/logger
+daemon_log_facility=daemon.notice
+self_log_facility=daemon.notice
+pidfile=/var/run/${me}.pid
+daemon_name=xe_daemon
+daemon_program="$1"
+shift
+
+test -x "${daemon_program}" || errx "cannot execute ${daemon_program}!"
+test -x ${logger} || errx "cannot execute ${logger}!"
+test -f ${pidfile} && errx "${pidfile} is already present -- is another instance of ${me} running?"
+echo $$ >${pidfile} || errx "cannot write to ${pidfile}!"
+tmpdir=`mktemp -d /tmp/${me}.XXXXXXXXXX` || errx "cannot generate tmpdir!"
+
+logfifo=${tmpdir}/fifo
+mkfifo -m 0600 ${logfifo} || errx "cannot generate fifo!"
+
+while true; do
+	trap 'break' 1 2 3 6 9 15
+	${logger} -i -p ${daemon_log_facility} -t ${daemon_name} <${logfifo} &
+	log_pid=$!
+	"${daemon_program}" $@ >${logfifo} 2>&1 &
+	daemon_pid=$!
+	wait ${daemon_pid}
+	${logger} -i -p ${self_log_facility} -t ${me} "${daemon_program} died -- restarting..."
+	sleep 2
+done
+
+kill -TERM ${daemon_pid} 2>/dev/null
+wait
+cleanup



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209171421.q8HELL5B034492>