diff options
author | Matteo Bernardini <ponce@slackbuilds.org> | 2015-12-18 16:15:48 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2016-01-17 09:40:16 +0700 |
commit | d2c08cfd5d22239b5f24eacb447e81356ad0bc7c (patch) | |
tree | 6f4bbd354e7795511b8dd2012ef210aad22d0322 | |
parent | 4988b15e5eded0957e65e5b9e2f0e200332bb493 (diff) |
libraries/libvirt: Updated for version 1.3.0.
rc.libvirt massaging for the new loggers
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r-- | libraries/libvirt/libvirt.SlackBuild | 2 | ||||
-rw-r--r-- | libraries/libvirt/libvirt.info | 6 | ||||
-rw-r--r-- | libraries/libvirt/rc.libvirt | 78 |
3 files changed, 67 insertions, 19 deletions
diff --git a/libraries/libvirt/libvirt.SlackBuild b/libraries/libvirt/libvirt.SlackBuild index 2210ac4110d95..687c4b2fe8eea 100644 --- a/libraries/libvirt/libvirt.SlackBuild +++ b/libraries/libvirt/libvirt.SlackBuild @@ -5,7 +5,7 @@ # Maintained by Robby Workman <rworkman@slackbuilds.org> PRGNAM=libvirt -VERSION=${VERSION:-1.2.21} +VERSION=${VERSION:-1.3.0} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} diff --git a/libraries/libvirt/libvirt.info b/libraries/libvirt/libvirt.info index aeb030e1e95ec..365485deb16c4 100644 --- a/libraries/libvirt/libvirt.info +++ b/libraries/libvirt/libvirt.info @@ -1,8 +1,8 @@ PRGNAM="libvirt" -VERSION="1.2.21" +VERSION="1.3.0" HOMEPAGE="http://libvirt.org" -DOWNLOAD="ftp://libvirt.org/libvirt/libvirt-1.2.21.tar.gz" -MD5SUM="76ab39194302b9067332e1f619c8bad9" +DOWNLOAD="ftp://libvirt.org/libvirt/libvirt-1.3.0.tar.gz" +MD5SUM="ac46f4d8114caa427590b28bef4a8b35" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="yajl urlgrabber" diff --git a/libraries/libvirt/rc.libvirt b/libraries/libvirt/rc.libvirt index 19bf66567e98b..68f49480e4484 100644 --- a/libraries/libvirt/rc.libvirt +++ b/libraries/libvirt/rc.libvirt @@ -12,21 +12,25 @@ # on your setup MODULES="tun vhost_net" -PIDFILE="/var/run/libvirt/libvirtd.pid" TIMEOUT=${TIMEOUT:-40} -OPTS=${OPTS:-" -v -f /etc/libvirt/libvirtd.conf -p $PIDFILE "} +LIBVIRTD_PIDFILE="/var/run/libvirt/libvirtd.pid" +LIBVIRTD_OPTS=${LIBVIRT_OPTS:-" -v -f /etc/libvirt/libvirtd.conf -p $LIBVIRTD_PIDFILE "} +VIRTLOGD_PIDFILE="/var/run/libvirt/virtlogd.pid" +VIRTLOGD_OPTS=${VIRTLOGD_OPTS:-" -v -f /etc/libvirt/virtlogd.conf -p $VIRTLOGD_PIDFILE "} +VIRTLOCKD_PIDFILE="/var/run/libvirt/virtlockd.pid" +VIRTLOCKD_OPTS=${VIRTLOCKD_OPTS:-" -v -f /etc/libvirt/virtlockd.conf -p $VIRTLOCKD_PIDFILE "} check_running_machines() { count=0 - for machine in $(virsh list --name --state-running | grep -v ^$) ; do + for machine in $(/usr/sbin/virsh list --name --state-running | grep -v ^$) ; do /usr/sbin/virsh shutdown $machine done echo -n "Waiting machines" - while [ $(virsh list --name --state-running | grep -v ^$ | wc -l) -gt "0" ]; do + while [ $(/usr/sbin/virsh list --name --state-running | grep -v ^$ | wc -l) -gt "0" ]; do if [ "$count" -ge "$TIMEOUT" ];then break fi @@ -37,10 +41,10 @@ check_running_machines() { echo "" - if [ $(virsh list --name --state-running | grep -v ^$ | wc -l) -gt "0" ];then + if [ $(/usr/sbin/virsh list --name --state-running | grep -v ^$ | wc -l) -gt "0" ];then echo -n "The following machines are still running, forcing shutdown: " - for machine in $(virsh list --name --state-running | grep -v ^$) ; do + for machine in $(/usr/sbin/virsh list --name --state-running | grep -v ^$) ; do /usr/sbin/virsh destroy $machine echo -n "$machine " done @@ -75,20 +79,20 @@ check_processor() { } -start() { - if [ -f $PIDFILE ];then +start_libvirtd() { + if [ -f $LIBVIRTD_PIDFILE ];then echo "libvirt is already running..." exit 1 fi echo "Starting libvirtd: /usr/sbin/libvirtd -d " - mkdir -p $(dirname $PIDFILE) + mkdir -p $(dirname $LIBVIRTD_PIDFILE) check_processor /sbin/modprobe -a $MODULES - /usr/sbin/libvirtd -d -l $OPTS + /usr/sbin/libvirtd -d -l $LIBVIRTD_OPTS } -stop() { - if [ ! -f $PIDFILE ];then +stop_libvirtd() { + if [ ! -f $LIBVIRTD_PIDFILE ];then echo "libvirt is not running..." exit 2 fi @@ -98,17 +102,61 @@ stop() { for network in $(/usr/sbin/virsh net-list | tail -n +3 | awk '{print $1}'); do /usr/sbin/virsh net-destroy "$network" done - kill -TERM $(cat $PIDFILE) + kill -TERM $(cat $LIBVIRTD_PIDFILE) sleep 3 /sbin/modprobe -ra $MODULES 2>/dev/null } +start_virtlogd() { + if [ -f $VIRTLOGD_PIDFILE ];then + echo "virtlogd is already running..." + exit 1 + fi + echo "Starting virtlogd: /usr/sbin/virtlogd -d " + mkdir -p $(dirname $VIRTLOGD_PIDFILE) + /usr/sbin/virtlogd -d $VIRTLOGD_OPTS +} + +stop_virtlogd() { + if [ ! -f $VIRTLOGD_PIDFILE ];then + echo "virtlogd is not running..." + exit 2 + fi + echo "Stopping virtlogd..." + kill -TERM $(cat $VIRTLOGD_PIDFILE) + sleep 1 +} + +start_virtlockd() { + if [ -f $VIRTLOCKD_PIDFILE ];then + echo "virtlockd is already running..." + exit 1 + fi + echo "Starting virtlockd: /usr/sbin/virtlockd -d " + mkdir -p $(dirname $VIRTLOCKD_PIDFILE) + /usr/sbin/virtlockd -d $VIRTLOCKD_OPTS +} + +stop_virtlockd() { + if [ ! -f $VIRTLOCKD_PIDFILE ];then + echo "virtlockd is not running..." + exit 2 + fi + echo "Stopping virtlockd..." + kill -TERM $(cat $VIRTLOCKD_PIDFILE) + sleep 1 +} + case $1 in start) - start + start_virtlockd + start_virtlogd + start_libvirtd ;; stop) - stop + stop_libvirtd + stop_virtlogd + stop_virtlockd ;; restart) stop |