Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (07f21a0c0b926fec15643bbb0afd9e4dda82568f)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Vlad Glagolev <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (07f21a0c0b926fec15643bbb0afd9e4dda82568f)
  • Date: Thu, 16 Feb 2012 21:12:21 -0600

GIT changes to master grimoire by Vlad Glagolev <stealth AT sourcemage.org>:

net/nsd/DETAILS | 4 -
net/nsd/HISTORY | 3
utils/xen/BUILD | 15 +++-
utils/xen/CONFIGURE | 4 +
utils/xen/DEPENDS | 20 +++--
utils/xen/DETAILS | 6 -
utils/xen/HISTORY | 17 ++++
utils/xen/INSTALL | 21 +++++-
utils/xen/PRE_BUILD | 5 +
utils/xen/init.d/xend | 123 ++++++++++++++++++++++++++++++-----
utils/xen/init.d/xend.conf | 8 ++
utils/xen/init.d/xendomains | 133
++++++++++++++++++++++++++++++++++++++
utils/xen/init.d/xendomains.conf | 136
+++++++++++++++++++++++++++++++++++++++
13 files changed, 454 insertions(+), 41 deletions(-)

New commits:
commit 07f21a0c0b926fec15643bbb0afd9e4dda82568f
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>

nsd: => 3.2.10

commit f2542b9465a1ad663fa709003131b1f0bf047fa1
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>

xen: level up ^^

diff --git a/net/nsd/DETAILS b/net/nsd/DETAILS
index 964b7ae..4eecebb 100755
--- a/net/nsd/DETAILS
+++ b/net/nsd/DETAILS
@@ -1,9 +1,9 @@
SPELL=nsd
- VERSION=3.2.9
+ VERSION=3.2.10
SECURITY_PATCH=1
SOURCE=$SPELL-$VERSION.tar.gz
SOURCE_URL[0]=http://www.nlnetlabs.nl/downloads/$SPELL/$SOURCE
-
SOURCE_HASH=sha512:1146c5ac1035ec2b3421ef8c7bb2eea4505928546678f76f287c0544db9fc449521a26b47a716e57c4ae90f3eb531c02930f07d6aca0e2c74e9e2ee64858f3e3
+
SOURCE_HASH=sha512:a96ebd73c9bc5c6f6fa994f326fb7f901bf6e4329ce9e5b2fe0b7eead527a7690125831f509acecf089a951030a78953b6ba0e1179aaa844ec72204f0cd8fa54
SOURCE_DIRECTORY="$BUILD_DIRECTORY/$SPELL-$VERSION"
WEB_SITE=http://www.nlnetlabs.nl/projects/nsd/
LICENSE[0]=BSD
diff --git a/net/nsd/HISTORY b/net/nsd/HISTORY
index 78475c8..1a46c94 100644
--- a/net/nsd/HISTORY
+++ b/net/nsd/HISTORY
@@ -1,3 +1,6 @@
+2012-02-17 Vlad Glagolev <stealth AT sourcemage.org>
+ * DETAILS: updated spell to 3.2.10
+
2011-12-10 Vlad Glagolev <stealth AT sourcemage.org>
* DETAILS: updated spell to 3.2.9

diff --git a/utils/xen/BUILD b/utils/xen/BUILD
index 65516c8..e930828 100755
--- a/utils/xen/BUILD
+++ b/utils/xen/BUILD
@@ -1,4 +1,11 @@
-unset LDFLAGS
-unset CFLAGS
-cd $SOURCE_DIRECTORY &&
-make dist-xen dist-tools dist-stubdom dist-misc
+unset LDFLAGS &&
+unset CFLAGS &&
+
+cd "$SOURCE_DIRECTORY" &&
+make xen tools &&
+
+if [[ $XEN_STUBDOM == y ]]; then
+ make_single &&
+ make stubdom &&
+ make_normal
+fi
diff --git a/utils/xen/CONFIGURE b/utils/xen/CONFIGURE
new file mode 100755
index 0000000..a1e249b
--- /dev/null
+++ b/utils/xen/CONFIGURE
@@ -0,0 +1,4 @@
+config_query XEN_HVM "Do you want to build HVM (hardware-assisted
virtualization) support" y &&
+config_query XEN_STUBDOM "Do you want to include Device Model Stub Domains?
support" y &&
+
+config_query XEN_UPINIT "Do you want to install upstream init scripts" y
diff --git a/utils/xen/DEPENDS b/utils/xen/DEPENDS
index 7c5832a..6002d09 100755
--- a/utils/xen/DEPENDS
+++ b/utils/xen/DEPENDS
@@ -1,16 +1,18 @@
-# this package provides a symlink needed to build xen
-# I'm less than happy with the symlink, but apparently it's not a problem
-# as identified in the gnustubs32 spell itself.
-# And it works fine for me :)
depends gnustubs32 &&
depends bridge-utils &&
depends python &&
-depends setuptools &&
-depends python-pam &&
+depends SETUPTOOLS &&
+depends pyxml &&
depends iproute2 &&
depends dev86 &&
depends curl &&
depends udev &&
-depends pyopenssl &&
-depends pyxml &&
-depends iasl
+
+if [[ $XEN_HVM == y ]]; then
+ depends iasl &&
+ depends sdl
+fi &&
+
+suggest_depends lxml "" "" "for XenAPI support in XM" &&
+suggest_depends pyopenssl "" "" "for SSL support" &&
+suggest_depends python-pam "" "" "for PAM support"
diff --git a/utils/xen/DETAILS b/utils/xen/DETAILS
index e5f03aa..43b7113 100755
--- a/utils/xen/DETAILS
+++ b/utils/xen/DETAILS
@@ -4,12 +4,12 @@
SOURCE2=$SOURCE.sig
SOURCE2_IGNORE=signature
SOURCE_GPG=xen.gpg:$SOURCE.sig:UPSTREAM_KEY
-SOURCE_DIRECTORY=${BUILD_DIRECTORY}/${SPELL}-${VERSION}
-
SOURCE_URL[0]=http://bits.xensource.com/oss-xen/release/${VERSION}/${SOURCE}
+SOURCE_DIRECTORY="${BUILD_DIRECTORY}/${SPELL}-${VERSION}"
+
SOURCE_URL[0]=http://bits.xensource.com/oss-${SPELL}/release/${VERSION}/${SOURCE}
SOURCE2_URL[0]=${SOURCE_URL[0]}.sig
WEB_SITE=http://www.xen.org
ENTERED=20041110
- PATCHLEVEL=1
+ PATCHLEVEL=2
LICENSE[0]=GPL
KEYWORDS="xen"
SHORT="Xen is a paravirtualising virtual machine monitor"
diff --git a/utils/xen/HISTORY b/utils/xen/HISTORY
index a38e910..62663c5 100644
--- a/utils/xen/HISTORY
+++ b/utils/xen/HISTORY
@@ -1,5 +1,18 @@
-2012-02-15 Vlad Glagolev <stealth AT sourcemage.org>
- * DETAILS: replaced non-existent var
+2012-02-17 Vlad Glagolev <stealth AT sourcemage.org>
+ * DETAILS: PATCHLEVEL++; quoting paths
+ * DEPENDS: made python-pam, pyopenssl, iasl optional; added missing
+ suggest and required dependencies
+ * CONFIGURE: added, for HVM and STUBDOM options, as well as ability to
+ choose installation of upstream init scripts
+ * PRE_BUILD: don't install upstream init scripts when selected
+ * BUILD: dist-misc does nothing for us; fixed multijob build for
stubdom
+ target; made stubdom optional
+ * INSTALL: fixed multijob install for stubdom target; made stubdom
+ optional; install appropriate configuration files for init scripts
+ * init.d/xend: rewritten from scratch
+ * init.d/xend.conf: added, for new init script
+ * init.d/xendomains{,.conf}: added 1st draft of scripting framework to
+ run domains properly

2011-01-30 David Kowis <dkowis AT shlrm.org>
* DEPENDS: depend on the gnustubs32 symlink spell
diff --git a/utils/xen/INSTALL b/utils/xen/INSTALL
index 437f62a..a60a3c6 100755
--- a/utils/xen/INSTALL
+++ b/utils/xen/INSTALL
@@ -1,3 +1,18 @@
-unset LDFLAGS
-unset CFLAGS
-make install-xen install-tools install-stubdom
+unset LDFLAGS &&
+unset CFLAGS &&
+
+make install-xen install-tools &&
+
+if [[ $XEN_STUBDOM == y ]]; then
+ make_single &&
+ make install-stubdom &&
+ make_normal
+fi &&
+
+if [[ $INIT_INSTALLED ]]; then
+ install_config_file "$SPELL_DIRECTORY/init.d/xend.conf" \
+ "$INSTALL_ROOT/etc/sysconfig/xend" &&
+
+ install_config_file "$SPELL_DIRECTORY/init.d/xendomains.conf" \
+ "$INSTALL_ROOT/etc/sysconfig/xendomains"
+fi
diff --git a/utils/xen/PRE_BUILD b/utils/xen/PRE_BUILD
index ec51a92..c7f9a4a 100755
--- a/utils/xen/PRE_BUILD
+++ b/utils/xen/PRE_BUILD
@@ -1,3 +1,8 @@
default_pre_build &&
cd ${SOURCE_DIRECTORY} &&
+
+if [[ $XEN_UPINIT != y ]]; then
+ sedit "s:all install-initd:all:" tools/hotplug/Linux/Makefile
+fi &&
+
sedit 's/lib64/lib/' config/StdGNU.mk
diff --git a/utils/xen/init.d/xend b/utils/xen/init.d/xend
index 318160d..6e05b5b 100755
--- a/utils/xen/init.d/xend
+++ b/utils/xen/init.d/xend
@@ -1,5 +1,7 @@
#!/bin/bash

+. /etc/sysconfig/xend
+
PROGRAM=/bin/false
RUNLEVEL=3
NEEDS="+local_fs +network"
@@ -7,23 +9,98 @@ PROVIDES="xend"
RECOMMENDED=yes

. /etc/init.d/smgl_init
-. /etc/init.d/smgl_functions

-await_daemons_up()
+XENSTORED_PIDFILE=/var/run/xenstored.pid
+XENCONSOLED_PIDFILE=/var/run/xenconsoled.pid
+
+# Wait for Xend to be up
+function await_daemons_up()
{
- i=1
- rets=10
- xend status
- while [ $? -ne 0 -a $i -lt $rets ]
- do
- sleep 1
- i=$(($i + 1))
- xend status
- done
+ i=1
+ rets=10
+ xend status
+ while [ $? -ne 0 -a $i -lt $rets ]; do
+ sleep 1
+ echo -n .
+ i=$(($i + 1))
+ xend status
+ done
+}
+
+function checkprocfs()
+{
+ if test -d /proc/xen && \
+ ! test -f /proc/xen/capabilities && \
+ ! grep '^xenfs ' /proc/mounts >/dev/null;
+ then
+ echo "XEN: Preparing proc filesystem..."
+ mount -t xenfs xenfs /proc/xen
+ evaluate_retval || exit 1
+ fi
+
+ echo "XEN: Detecting capabilities..."
+ if ! grep -q "control_d" /proc/xen/capabilities ; then
+ print_status failure
+ exit 1
+ else
+ print_status success
+ fi
}

start()
{
+ checkprocfs
+
+ required_executable /usr/bin/xenstore-read
+ required_executable /usr/bin/xenstore-write
+ required_executable /usr/sbin/xenstored
+ required_executable /usr/sbin/xenconsoled
+
+ local time=0
+ local timeout=30
+
+ if ! `xenstore-read -s / >/dev/null 2>&1`; then
+ rm -f "$XENSTORED_ROOTDIR"/tdb* &>/dev/null
+ test -z "$XENSTORED_TRACE" || XENSTORED_ARGS=" -T
/var/log/xen/xenstored-trace.log"
+
+ echo -n "XEN: Starting xenstored..."
+ xenstored --pid-file=$XENSTORED_PIDFILE $XENSTORED_ARGS
+
+ # Wait for xenstored to actually come up, timing out after 30 seconds
+ while [ $time -lt $timeout ] && ! `xenstore-read -s / >/dev/null 2>&1` ;
do
+ echo -n '.'
+ time=$(($time+1))
+ sleep 1
+ done
+ echo
+
+ # Exit if we timed out
+ if ! [ $time -lt $timeout ] ; then
+ print_status failure
+ exit 1
+ else
+ print_status success
+ fi
+
+ echo "XEN: Setting domain 0 name..."
+ xenstore-write "/local/domain/0/name" "Domain-0"
+ evaluate_retval
+ fi
+
+ echo "XEN: Starting xenconsoled..."
+ test -z "$XENCONSOLED_TRACE" || XENCONSOLED_ARGS="
--log=$XENCONSOLED_TRACE"
+ xenconsoled --pid-file=$XENCONSOLED_PIDFILE $XENCONSOLED_ARGS
+ evaluate_retval || exit 1
+
+ # mkdir shouldn't be needed as most distros have this already created.
Default to using subsys.
+ # See docs/misc/distro_mapping.txt
+ mkdir -p /var/lock
+ if [ -d /var/lock/subsys ] ; then
+ touch /var/lock/subsys/xend
+ else
+ touch /var/lock/xend
+ fi
+
xend start
await_daemons_up
}
@@ -31,10 +108,23 @@ start()
stop()
{
xend stop
+ rm -f /var/lock/subsys/xend /var/lock/xend
+
+ echo "XEN: Stopping xenconsoled..."
+ if read 2>/dev/null <$XENCONSOLED_PIDFILE pid; then
+ kill $pid
+ while kill -9 $pid >/dev/null 2>&1; do sleep 0.1; done
+ evaluate_retval
+ rm -f $XENCONSOLED_PIDFILE
+ fi
+
+ echo "XEN: WARNING: Not stopping xenstored, as it cannot be restarted."
}

status()
{
+ xenstore-read -s /
+
xend status
}

@@ -45,12 +135,9 @@ reload()

restart()
{
- xend restart
- await_daemons_up
-}
+ echo "XEN: Restarting..."

-force-reload()
-{
- restart
+ stop
+ sleep 1
+ start
}
-
diff --git a/utils/xen/init.d/xend.conf b/utils/xen/init.d/xend.conf
new file mode 100644
index 0000000..69d8dcb
--- /dev/null
+++ b/utils/xen/init.d/xend.conf
@@ -0,0 +1,8 @@
+# Log xenconsoled messages (cf xl dmesg): [none|guest|hv|all]
+#XENCONSOLED_TRACE=
+
+# Log xenstored messages: [yes|on|1]
+#XENSTORED_TRACE=
+
+# Running xenstored on XENSTORED_ROOTDIR
+XENSTORED_ROOTDIR=/var/lib/xenstored
diff --git a/utils/xen/init.d/xendomains b/utils/xen/init.d/xendomains
new file mode 100755
index 0000000..75cc264
--- /dev/null
+++ b/utils/xen/init.d/xendomains
@@ -0,0 +1,133 @@
+#!/bin/bash
+
+. /etc/sysconfig/xendomains
+
+PROGRAM=/bin/false
+RUNLEVEL=3
+NEEDS="+xend"
+
+. /etc/init.d/smgl_init
+
+function check_userland()
+{
+ echo "XEN: Checking userland environment..."
+
+ required_executable /usr/sbin/xm
+ CMD=xm
+
+ $CMD list &> /dev/null
+ if test $? -ne 0; then
+ required_executable /usr/sbin/xl
+ CMD=xl
+ fi
+
+ $CMD list &> /dev/null
+ if test $? -ne 0; then
+ print_status failure
+ exit 1
+ fi
+
+ # Correct exit code would probably be 5, but it's enough
+ # if xend complains if we're not running as privileged domain
+ if ! [ -e /proc/xen/privcmd ]; then
+ print_status failure
+ exit 1
+ fi
+
+ # See docs/misc/distro_mapping.txt
+ if [ -d /var/lock/subsys ]; then
+ LOCKFILE=/var/lock/subsys/xendomains
+ else
+ LOCKFILE=/var/lock/xendomains
+ fi
+
+ print_status success
+}
+
+function get_domname()
+{
+ local name_from_file=$(sed -rn
's/^name\W*=\W*\"?([[:alnum:]_\.-]+)\"?\W*;?/\1/p' "${1}" | tail -n 1)
+
+ if [[ -z ${name_from_file} ]] ; then
+ basename "${1}"
+ else
+ echo ${name_from_file}
+ fi
+}
+
+function is_running()
+{
+ $CMD list "${1}" >/dev/null 2>&1
+}
+
+start()
+{
+ check_userland
+
+ if [ -f $LOCKFILE ]; then
+ echo -e "XEN: xendomains already running (lockfile exists)"
+ exit 0
+ fi
+
+ if [ $(ls ${XENDOMAINS_AUTO} | wc -l) == 0 ]; then
+ echo "XEN: no domains in ${XENDOMAINS_AUTO}"
+ exit 0
+ fi
+
+ touch $LOCKFILE
+ echo "XEN: Starting domains:"
+ for dom in $(ls "${XENDOMAINS_AUTO}/"* 2>/dev/null | sort); do
+ name=$(get_domname ${dom})
+ echo "XEN: domain ${name}... "
+ if ! is_running ${name}; then
+ $CMD create --quiet --defconfig $dom
+ evaluate_retval
+ else
+ echo -n "(skip: already running)"
+ fi
+ done
+}
+
+stop()
+{
+ check_userland
+
+ if [ $(ls ${XENDOMAINS_AUTO} | wc -l) == 0 ]; then
+ echo "XEN: no domains in ${XENDOMAINS_AUTO}"
+ exit 0
+ fi
+
+ DOMAINS="$(ls "${XENDOMAINS_AUTO}/"* 2>/dev/null | sort -r)"
+
+ echo "XEN: Shutting down domains:"
+ for dom in $DOMAINS; do
+ name=$(get_domname ${dom})
+ echo "XEN: Waiting for domain ${name} to shutdown... "
+ if is_running ${name}; then
+ $CMD shutdown -w ${name} > /dev/null
+ evaluate_retval
+ else
+ echo -n "(skip: not running)"
+ fi
+ done
+
+ rm -f $LOCKFILE
+}
+
+status()
+{
+ check_userland
+
+ $CMD list
+}
+
+restart()
+{
+ stop
+ start
+}
+
+reload()
+{
+ restart
+}
diff --git a/utils/xen/init.d/xendomains.conf
b/utils/xen/init.d/xendomains.conf
new file mode 100644
index 0000000..27d12cc
--- /dev/null
+++ b/utils/xen/init.d/xendomains.conf
@@ -0,0 +1,136 @@
+## Path: System/xen
+## Description: xen domain start/stop on boot
+## Type: string
+## Default:
+#
+# The xendomains script can send SysRq requests to domains on shutdown.
+# If you don't want to MIGRATE, SAVE, or SHUTDOWN, this may be a possibility
+# to do a quick and dirty shutdown ("s e i u o") or at least sync the disks
+# of the domains ("s").
+#
+XENDOMAINS_SYSRQ=""
+
+## Type: integer
+## Default: 100000
+#
+# If XENDOMAINS_SYSRQ is set, this variable determines how long to wait
+# (in microseconds) after each SysRq, so the domain has a chance to react.
+# If you want to a quick'n'dirty shutdown via SysRq, you may want to set
+# it to a relatively high value (1200000).
+#
+XENDOMAINS_USLEEP=100000
+
+## Type: integer
+## Default: 5000000
+#
+# When creating a guest domain, it is sensible to allow a little time for it
+# to get started before creating another domain or proceeding through the
+# boot process. Without this, the booting guests will thrash the disk as
they
+# start up. This timeout (in microseconds) specifies the delay after guest
+# domain creation.
+#
+XENDOMAINS_CREATE_USLEEP=5000000
+
+## Type: string
+## Default: ""
+#
+# Set this to a non-empty string if you want to migrate virtual machines
+# on shutdown. The string will be passed to the xm migrate DOMID command
+# as is: It should contain the target IP address of the physical machine
+# to migrate to and optionally parameters like --live. Leave empty if
+# you don't want to try virtual machine relocation on shutdown.
+# If migration succeeds, neither SAVE nor SHUTDOWN will be executed for
+# that domain.
+#
+XENDOMAINS_MIGRATE=""
+
+## Type: string
+## Default: /var/lib/xen/save
+#
+# Directory to save running domains to when the system (dom0) is
+# shut down. Will also be used to restore domains from if #
XENDOMAINS_RESTORE
+# is set (see below). Leave empty to disable domain saving on shutdown
+# (e.g. because you rather shut domains down).
+# If domain saving does succeed, SHUTDOWN will not be executed.
+#
+XENDOMAINS_SAVE=/var/lib/xen/save
+
+## Type: string
+## Default: "--halt --wait"
+#
+# If neither MIGRATE nor SAVE were enabled or if they failed, you can
+# try to shut down a domain by sending it a shutdown request. To do this,
+# set this to "--halt --wait". Omit the "--wait" flag to avoid waiting
+# for the domain to be really down. Leave empty to skip domain shutdown.
+#
+XENDOMAINS_SHUTDOWN="--halt --wait"
+
+## Type: string
+## Default: "--all --halt --wait"
+#
+# After we have gone over all virtual machines (resp. all automatically
+# started ones, see XENDOMAINS_AUTO_ONLY below) in a loop and sent SysRq,
+# migrated, saved and/or shutdown according to the settings above, we
+# might want to shutdown the virtual machines that are still running
+# for some reason or another. To do this, set this variable to
+# "--all --halt --wait", it will be passed to xm shutdown.
+# Leave it empty not to do anything special here.
+# (Note: This will hit all virtual machines, even if XENDOMAINS_AUTO_ONLY
+# is set.)
+#
+XENDOMAINS_SHUTDOWN_ALL="--all --halt --wait"
+
+## Type: boolean
+## Default: true
+#
+# This variable determines whether saved domains from XENDOMAINS_SAVE
+# will be restored on system startup.
+#
+XENDOMAINS_RESTORE=true
+
+## Type: string
+## Default: /etc/xen/auto
+#
+# This variable sets the directory where domains configurations
+# are stored that should be started on system startup automatically.
+# Leave empty if you don't want to start domains automatically
+# (or just don't place any xen domain config files in that dir).
+# Note that the script tries to be clever if both RESTORE and AUTO are
+# set: It will first restore saved domains and then only start domains
+# in AUTO which are not running yet.
+# Note that the name matching is somewhat fuzzy.
+#
+XENDOMAINS_AUTO=/etc/xen/auto
+
+## Type: boolean
+## Default: false
+#
+# If this variable is set to "true", only the domains started via config
+# files in XENDOMAINS_AUTO will be treated according to XENDOMAINS_SYSRQ,
+# XENDOMAINS_MIGRATE, XENDOMAINS_SAVE, XENDMAINS_SHUTDOWN; otherwise
+# all running domains will be.
+# Note that the name matching is somewhat fuzzy.
+#
+XENDOMAINS_AUTO_ONLY=false
+
+## Type: integer
+## Default: 300
+#
+# On xendomains stop, a number of xm commands (xm migrate, save, shutdown,
+# shutdown --all) may be executed. In the worst case, these commands may
+# stall forever, which will prevent a successful shutdown of the machine.
+# If this variable is non-zero, the script will set up a watchdog timer
+# for every of these xm commands and time it out after the number of seconds
+# specified by this variable.
+# Note that SHUTDOWN_ALL will not be called if no virtual machines or only
+# zombies are still running, so you don't need to enable this timeout just
+# for the zombie case.
+# The setting should be large enough to make sure that migrate/save/shutdown
+# can succeed. If you do live migrations, keep in mind that live migration
+# of a 1GB machine over Gigabit ethernet may actually take something like
+# 100s (assuming that live migration uses 10% of the network # bandwidth).
+# Depending on the virtual machine, a shutdown may also require a significant
+# amount of time. So better setup this variable to a huge number and hope the
+# watchdog never fires.
+#
+XENDOMAINS_STOP_MAXWAIT=300



  • [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (07f21a0c0b926fec15643bbb0afd9e4dda82568f), Vlad Glagolev, 02/16/2012

Archive powered by MHonArc 2.6.24.

Top of Page