From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Oct 8 00:50:15 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 783BB1065670 for ; Mon, 8 Oct 2012 00:50:15 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 53FB88FC0C for ; Mon, 8 Oct 2012 00:50:15 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q980oFFc036005 for ; Mon, 8 Oct 2012 00:50:15 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q980oFAB036004; Mon, 8 Oct 2012 00:50:15 GMT (envelope-from gnats) Resent-Date: Mon, 8 Oct 2012 00:50:15 GMT Resent-Message-Id: <201210080050.q980oFAB036004@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Mark Felder Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 200F51065673 for ; Mon, 8 Oct 2012 00:42:21 +0000 (UTC) (envelope-from feld@feld.me) Received: from feld.me (unknown [IPv6:2607:f4e0:100:300::2]) by mx1.freebsd.org (Postfix) with ESMTP id DF9288FC17 for ; Mon, 8 Oct 2012 00:42:20 +0000 (UTC) Received: from feld by feld.me with local (Exim 4.80 (FreeBSD)) (envelope-from ) id 1TL1QK-000NoN-7D for FreeBSD-gnats-submit@freebsd.org; Sun, 07 Oct 2012 19:42:20 -0500 Message-Id: Date: Sun, 07 Oct 2012 19:42:20 -0500 From: Mark Felder To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/172466: [PATCH] sysutils/xen-tools: splitting out guest scripts X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Oct 2012 00:50:15 -0000 >Number: 172466 >Category: ports >Synopsis: [PATCH] sysutils/xen-tools: splitting out guest scripts >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Mon Oct 08 00:50:07 UTC 2012 >Closed-Date: >Last-Modified: >Originator: feld >Release: FreeBSD 9.1-PRERELEASE amd64 >Organization: >Environment: System: FreeBSD mwi1.coffeenet.org 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #5 r239731: Mon Aug 27 09:53:18 CDT >Description: Splitting out guest scripts into another port called sysutils/xe-guest-utilities. This tracks what NetBSD is doing and at some point in the future we may be able to share a common codebase. Another thing we should consider is renaming sysutils/xen-tools to sysutils/xenstoretools also to mimic what NetBSD is doing since dom0 support is slated for the FreeBSD 10 release. When you have a fully functional dom0 available it makes more sense to have xentools be the tools for the dom0. Here's a list of NetBSD's xen ports to demonstrate what I mean: sysutils/xe-guest-utilities-6.0.2nb3: NetBSD VM tools for Citrix XenServer sysutils/xenkernel20-2.0.7: Xen Kernel sysutils/xenkernel3-3.1.4nb6: Xen3 Kernel sysutils/xenkernel33-3.3.2nb6: Xen 3.3.2 Kernel sysutils/xenkernel41-4.1.3: Xen 4.1.x Kernel sysutils/xenstoretools-4.1.3: Xenstore Tools for Xen 4.1.x sysutils/xentools20-2.0.7nb15: Userland Tools for Xen sysutils/xentools3-3.1.4nb11: Userland Tools for Xen sysutils/xentools3-hvm-3.1.4nb7: Tools for Virtual Machine Extensions support in Xen sysutils/xentools33-3.3.2nb14: Userland Tools for Xen 3.3.x sysutils/xentools41-4.1.3nb2: Userland Tools for Xen 4.1.x Removed file(s): - files/xe-daemon.in - files/xe_wrapper Generated with FreeBSD Port Tools 0.99_6 (mode: change, diff: suffix) >How-To-Repeat: >Fix: --- xen-tools-4.1.3_3.patch begins here --- diff -ruN --exclude=CVS ../xen-tools.orig/Makefile ./Makefile --- ../xen-tools.orig/Makefile 2012-09-19 14:46:07.000000000 -0500 +++ ./Makefile 2012-10-07 19:34:00.372536206 -0500 @@ -6,27 +6,18 @@ PORTNAME= xen-tools PORTVERSION= 4.1.3 -PORTREVISION= 2 +PORTREVISION= 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}/: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/ +MASTER_SITES= http://bits.xensource.com/oss-xen/release/${PORTVERSION}/ +DISTFILES= xen-${PORTVERSION}.tar.gz USE_GMAKE= yes USE_PYTHON= yes -USE_RC_SUBR= xe-daemon ONLY_FOR_ARCHS= amd64 i386 ia64 ONLY_FOR_ARCHS_REASON= "not yet ported to anything other than amd64, i386, or ia64" @@ -42,9 +33,6 @@ bin/xenstore-read \ bin/xenstore-rm \ bin/xenstore-write \ - sbin/xe-daemon \ - sbin/xe-update-guest-attrs \ - sbin/xe_wrapper do-build: cd ${WRKSRC}/tools && ${GMAKE} -C include @@ -56,9 +44,6 @@ ${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 diff -ruN --exclude=CVS ../xen-tools.orig/distinfo ./distinfo --- ../xen-tools.orig/distinfo 2012-09-17 09:21:21.000000000 -0500 +++ ./distinfo 2012-10-07 14:09:37.000000000 -0500 @@ -1,4 +1,2 @@ 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 diff -ruN --exclude=CVS ../xen-tools.orig/files/xe-daemon.in ./files/xe-daemon.in --- ../xen-tools.orig/files/xe-daemon.in 2012-09-19 14:46:07.000000000 -0500 +++ ./files/xe-daemon.in 1969-12-31 18:00:00.000000000 -0600 @@ -1,29 +0,0 @@ -#!/bin/sh - -# $FreeBSD: ports/sysutils/xen-tools/files/xe-daemon.in,v 1.2 2012/09/19 19:46:07 swills Exp $ -# -# 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 - -load_rc_config $name - -: ${xe_daemon_enable="NO"} - -command="%%PREFIX%%/sbin/xe_wrapper" -command_interpreter="/bin/sh -T" -command_args='%%PREFIX%%/sbin/xe-daemon &' -pidfile="/var/run/xe_wrapper.pid" - -run_rc_command "$1" diff -ruN --exclude=CVS ../xen-tools.orig/files/xe_wrapper ./files/xe_wrapper --- ../xen-tools.orig/files/xe_wrapper 2012-09-17 09:21:21.000000000 -0500 +++ ./files/xe_wrapper 1969-12-31 18:00:00.000000000 -0600 @@ -1,91 +0,0 @@ -#!/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: ports/sysutils/xen-tools/files/xe_wrapper,v 1.1 2012/09/17 14:21:21 swills Exp $ -# -# 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 --- xen-tools-4.1.3_3.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: