parent
75183385bb
commit
8d36228add
@ -1,17 +1,17 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQJNBAABCgA3FiEEm8dazQnvu0U1Gdmc9s+lqZ57WVcFAl7IqmEZHGd6YW11ZGlv
|
||||
QGxpYnJlbWV4Lm9yZy5teAAKCRD2z6WpnntZV0hYD/9Sqw5F/QmqrgFLyKZKrjwi
|
||||
UEdcIwXFzbb50Cc0Qb92cYWxlKeK+0+BG5aPGI8n9DtU9r09F3vLf8E2Asa5hUBN
|
||||
RECL2Vj+Jy+fFc5cL01VlhA9PrItWmHfeE4lGvoHX969Rd+s6Qjfl7djlJIExdsX
|
||||
9npNn2fzokkisIJfj/V+xcbawyV9tbloo2ne1u9pvAvhFWDXglcHyzVdzBbmShfU
|
||||
E/tc16dUtWB1Sw9PVoCWbz86bDbpUBwQSaQCPYh37KJ1WerRzVMApRDt4vMKIO4y
|
||||
r+0yY+zYfziqeWxJez2wPIpT3KGWHKdRg91gAAxL7gbbREuhBEvSo3FcWAaNQBRl
|
||||
VrFVccEn5KXj3g6N/r4eS89rKyHCCqnbpulddYfxlJcQbawGY1WZx70V1Dp28GWV
|
||||
gj4T5oHOuhhQrdiPPwIVfZFCybBFoAhLd/VoTIWLaCp6bcdVMsRLgjHz4Mr4KB37
|
||||
GM/LBR4BaKrxOz3SAbTwala8NEoj4Pqa5WrTvkoMK4q303u1OuwVSVOO9CQHzF4s
|
||||
H9ftix45cyUw4NrvdM4Y+vK+5suj/3pG2idT1k6jhb56PO1t1wL5SjB2EF8PTvn3
|
||||
DgN5KX1eoBOrDDzXle56VGZdMcTOMs28NL6bB0Nm86JX1abgtRTGbSsHP76tHzte
|
||||
M0pRwS0Ms0H6XrGZ86XSLg==
|
||||
=KrVS
|
||||
iQJNBAABCgA3FiEEm8dazQnvu0U1Gdmc9s+lqZ57WVcFAl7IqxkZHGd6YW11ZGlv
|
||||
QGxpYnJlbWV4Lm9yZy5teAAKCRD2z6WpnntZV29HD/9DarSZp0Sxp3OPXOBDJh5y
|
||||
VhoHW5MM5ahpGljD97RGksGIhldy7/MgmPvigE5ilW7/XMLm9tb5RfbtccI7psNR
|
||||
5NexuCWiffz5qjHbPqFyYZh8LsF2Mkjy8w2NWvjSdM32o2TvVO4aclCIVZUhJtxN
|
||||
WieTUywXfBA2Bn4wp9ue6QblmwPowzBcgP2cJuOOlQQQAEIJovT1N13VumKT3Qn1
|
||||
y10P9wr55l2OgBzar8Ue1sTYvj5Z706/l3HowJM1jO/V8SmmMtxLTWuGEvh0VHyO
|
||||
P2SmgVnpHMTypqZH8kf1m3asF35nNEshfaFIHM3MTbrXNFoCuBClzdpMdo+ZiL1q
|
||||
q9SeDfB2k1sQB6vWlRRPYYc8GwSUVJ1EgzkMN9rWPBZrscrUFV/BV0Vx0hvd7pW/
|
||||
LdDDXvSYeur5X7XaDV+hw0fV6oLciIqmeO8rWYpFwYjiquFhbjEdHxGRBdwxgaKP
|
||||
i/B/GzAHrjqOJXlDiFqGkvg2oQECaHd/rEHUJG0CHq82xJ083AhQ5usZVy0DpoK6
|
||||
4xmkR8gSRyImvj1+w/OaR/1Asb9utjbTokAI7Q24DsGNd3A+E7/BEqnGjezncM6G
|
||||
yN0zodym98I29zi2eFbmn70d7qyKVo+LpN2DwhlK12C/NvD1otDZjTYFAw5C9kQI
|
||||
otUaDBz+AMwYVaCg9iwpqw==
|
||||
=kvt0
|
||||
-----END PGP SIGNATURE-----
|
||||
|
Binary file not shown.
@ -1,17 +1,17 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQJNBAABCgA3FiEEm8dazQnvu0U1Gdmc9s+lqZ57WVcFAl7IqmEZHGd6YW11ZGlv
|
||||
QGxpYnJlbWV4Lm9yZy5teAAKCRD2z6WpnntZV5kxD/9kgXI54eYnVzQBh1INeXTz
|
||||
gRGupAKaqYMHDSgxZQ5SgYlsZwpGrRVu+/Z+GixCZcmD76rr9ogQbPwGKx+hvmiz
|
||||
bMSewaeORCn8HF6NVKEi5cdToLmYSqK6Ap6vj7oM6ckcJ47eXllFy3htyUhOXWF4
|
||||
vUdiA5b5Q9VLT3MzeaiWVQhzzTMMD83j6f6Z32RH9/WGU32Oj3nuMfdEEOCCHMWA
|
||||
bAYSZPIRZi8dwMhjj6UykfIgozHgPn5uYvLgrjyHiMF3B2jJGzt3Ez+xXPgN8HZi
|
||||
5Vr8T+eNvAKMn3Xx2iU6cuhbgkAuM8SLSwgvG5hNLEx2PdLYSus7SjPFg4IMAPpl
|
||||
3k5MkmBFJYVQLlenxU1HyUgb4A8nbT70pPKPcN2FKW1mXd42R1IrjSzZC5vgcmWC
|
||||
SV6srmKu+6K1B0+bNpSgU/5yDd335I45NbyHyzuUNOpOU8q7PV25dQUWNL875bYR
|
||||
Qyz6fc8r3T1xBGBUlmpKEa9mKX9iHIDqmeeGB8JrGJ1m0HnvTXAKeXm8YrqB0fcq
|
||||
YhR7LOnz1z1hMGPOQ/leEMn88/w36ORDjSa1mOmfL7yxG1f8Q7Rz+5poZy5XGzOH
|
||||
ogiNz87oA218wT9tHJIaLRiA+KvuiM4pu93V+HCk3zKEQI6QtVZIXSXgnQsx+xQW
|
||||
G8gbFmP98pIUDslS95ZqZg==
|
||||
=sQm3
|
||||
iQJNBAABCgA3FiEEm8dazQnvu0U1Gdmc9s+lqZ57WVcFAl7IqxkZHGd6YW11ZGlv
|
||||
QGxpYnJlbWV4Lm9yZy5teAAKCRD2z6WpnntZV5NWEACZdigH5LYloHtDvyLRWUk1
|
||||
91mX4FAZMqlse3x78OmbujulW80jZ3LtTS61u84AJY7R1FjhYVKTeuQ67J83bzNr
|
||||
OIR77ji8dAD8sOilo+gUTsuK/nzrwqFkhgHVkgz4OGf6wJezPTasrv4KA6KfsoBJ
|
||||
HTblfw9KWReJWfEyvv9MWrZ2LXyB0Ai+cBRcpCdFFyZIrPREustDwpMDQmMYZZL3
|
||||
ZrwSzvk71rNLnjJ03zKEUQPsrmPnAXydl0zYgN6Z2t5YAuy06VBtngrmpJsafIGj
|
||||
tS0D6gArqC+msH5QMpiesZHWucQJxxnPXdQifIE43Wp3+nkq0C//6yC4gOQQ4yFu
|
||||
uLAzaQwgsN1XdHS/r+W6waNQL/5aZVEh//P+wrciqh0Xy5qwkMHaALZpHEuKGnUd
|
||||
igbicgeZ5cdqTE0pLlwql2XCsitj/2xEewbuuvrx1DdW6RH6bI21ajTadBbRDlrB
|
||||
sHJ5vLPVml8Y3MUMEKo97Cs864HnMMyT9Mj2EWzgGGNkxyOct9gFYXTAscLTF38c
|
||||
sMAat/kh0G6wcdm4yI8gzW+JoaI1rgmemW8KWH88ZNX+hEJXm7GPR6zwi9aVjne1
|
||||
7AfkhAEhz1y/Tm5QR3bVLbK8iG1mtYlL1U5CrDbmhWkqOMV3ghC+3wKwFhv8gIu4
|
||||
xunF/xWVeoaalzido8pr4A==
|
||||
=JeBw
|
||||
-----END PGP SIGNATURE-----
|
||||
|
Binary file not shown.
@ -1,2 +1,2 @@
|
||||
PACKAGES.TXT; Sat May 23 04:45:17 UTC 2020
|
||||
PACKAGES.TXT; Sat May 23 04:48:20 UTC 2020
|
||||
|
||||
|
Binary file not shown.
@ -0,0 +1,19 @@
|
||||
# HOW TO EDIT THIS FILE:
|
||||
# The "handy ruler" below makes it easier to edit a package description.
|
||||
# Line up the first '|' above the ':' following the base package name, and
|
||||
# the '|' on the right side marks the last column you can put a character in.
|
||||
# You must make exactly 11 lines for the formatting to be correct. It's also
|
||||
# customary to leave one space after the ':' except on otherwise blank lines.
|
||||
|
||||
|-----handy-ruler------------------------------------------------------|
|
||||
libvirt: libvirt (The virtualization API)
|
||||
libvirt:
|
||||
libvirt: libvirt is a toolkit to interact with the virtualization
|
||||
libvirt: capabilities of recent versions of Linux (and other OSes).
|
||||
libvirt:
|
||||
libvirt: Homepage: http://libvirt.org
|
||||
libvirt:
|
||||
libvirt:
|
||||
libvirt:
|
||||
libvirt:
|
||||
libvirt:
|
@ -0,0 +1,19 @@
|
||||
# HOW TO EDIT THIS FILE:
|
||||
# The "handy ruler" below makes it easier to edit a package description.
|
||||
# Line up the first '|' above the ':' following the base package name, and
|
||||
# the '|' on the right side marks the last column you can put a character in.
|
||||
# You must make exactly 11 lines for the formatting to be correct. It's also
|
||||
# customary to leave one space after the ':' except on otherwise blank lines.
|
||||
|
||||
|-----handy-ruler------------------------------------------------------|
|
||||
libvirt: libvirt (The virtualization API)
|
||||
libvirt:
|
||||
libvirt: libvirt is a toolkit to interact with the virtualization
|
||||
libvirt: capabilities of recent versions of Linux (and other OSes).
|
||||
libvirt:
|
||||
libvirt: Homepage: http://libvirt.org
|
||||
libvirt:
|
||||
libvirt:
|
||||
libvirt:
|
||||
libvirt:
|
||||
libvirt:
|
@ -0,0 +1,53 @@
|
||||
libvirt - The virtualization API
|
||||
|
||||
libvirt is a toolkit to interact with the virtualization
|
||||
capabilities of recent versions of Linux (and other OSes).
|
||||
|
||||
Most optional dependencies are autodetected and having the required
|
||||
libs in place will build the respective features automatically.
|
||||
|
||||
The group can be specified at build time like this:
|
||||
VIRTGROUP=somegroup ./libvirt.SlackBuild (default: users)
|
||||
You'll want to keep this in sync with what qemu uses (it also
|
||||
defaults to the "users" group).
|
||||
|
||||
If you want to start the libvirt daemon at boot, add this
|
||||
to /etc/rc.d/rc.local
|
||||
|
||||
# Start libvirt:
|
||||
if [ -x /etc/rc.d/rc.libvirt ]; then
|
||||
/etc/rc.d/rc.libvirt start
|
||||
fi
|
||||
|
||||
and if you want it to stop at shutdown add this to
|
||||
/etc/rc.d/rc.local_shutdown
|
||||
|
||||
# Stop libvirt:
|
||||
if [ -x /etc/rc.d/rc.libvirt ]; then
|
||||
/etc/rc.d/rc.libvirt stop
|
||||
fi
|
||||
|
||||
The enclosed rc.libvirt script will do a 'managedsave' on all running
|
||||
and paused guests when issuing 'rc.libvirt stop'. Please note that this
|
||||
saves the RAM of each guest to the host system's disk (by default under
|
||||
/var/lib/libvirt/qemu/save) - so make sure enough space is available. If
|
||||
you prefer to perform a full shutdown on all running guests instead,
|
||||
issue a 'rc.libvirt guests_shutdown' followed by 'rc.libvirt shutdown'.
|
||||
|
||||
By default 'rc.libvirt stop' and 'rc.libvirt guests_shutdown' will wait
|
||||
a maximum of 5 minutes for all guests to shutdown, after which any
|
||||
guests still running will be destroyed. Adjust this to a suitable value
|
||||
for your system, as destroying a running guest carries a high risk of
|
||||
data loss!
|
||||
|
||||
There is also a 'guests_reboot' for rebooting all running guests.
|
||||
|
||||
Have a look at the commented part of rc.libvirt for some gotchas.
|
||||
|
||||
netcat-openbsd is an optional dependency (needed if you
|
||||
want to connect from a remote host using virt-manager).
|
||||
Other optional dependencies include avahi, xen, audit, glusterfs,
|
||||
and numactl.
|
||||
|
||||
As of the 4.5.0 version, you may have to remove any previously
|
||||
installed versions of libvirt before this will build.
|
@ -0,0 +1,136 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Slackware build script for libvirt
|
||||
# Written by Michal Bialozor <bialyy@o2.pl>
|
||||
# Maintained by Robby Workman <rworkman@slackbuilds.org>
|
||||
|
||||
PRGNAM=libvirt
|
||||
VERSION=${VERSION:-5.10.0}
|
||||
BUILD=${BUILD:-1}
|
||||
TAG=${TAG:-_SBo}
|
||||
|
||||
if [ -z "$ARCH" ]; then
|
||||
case "$( uname -m )" in
|
||||
i?86) ARCH=i586 ;;
|
||||
arm*) ARCH=arm ;;
|
||||
*) ARCH=$( uname -m ) ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
CWD=$(pwd)
|
||||
TMP=${TMP:-/tmp/SBo}
|
||||
PKG=$TMP/package-$PRGNAM
|
||||
OUTPUT=${OUTPUT:-/tmp}
|
||||
|
||||
if [ "$ARCH" = "i586" ]; then
|
||||
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
||||
LIBDIRSUFFIX=""
|
||||
elif [ "$ARCH" = "x86_64" ]; then
|
||||
SLKCFLAGS="-O2 -fPIC"
|
||||
LIBDIRSUFFIX="64"
|
||||
else
|
||||
SLKCFLAGS="-O2"
|
||||
LIBDIRSUFFIX=""
|
||||
fi
|
||||
|
||||
VIRTGROUP=${VIRTGROUP:-users}
|
||||
|
||||
set -e
|
||||
|
||||
rm -rf $PKG
|
||||
mkdir -p $TMP $PKG $OUTPUT
|
||||
cd $TMP
|
||||
rm -rf $PRGNAM-$VERSION
|
||||
tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
|
||||
cd $PRGNAM-$VERSION
|
||||
chown -R root:root .
|
||||
find -L . \
|
||||
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
||||
-o -perm 511 \) -exec chmod 755 {} \; -o \
|
||||
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
||||
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
|
||||
|
||||
# we have sysctld files in /etc/sysctl.d
|
||||
sed -i "s|(prefix)/lib/sysctl|(sysconfdir)/sysctl|" src/Makefile.in
|
||||
|
||||
patch -p1 < $CWD/use-virtgroup-in-polkit-rules.diff
|
||||
sed -i -e "s,@VIRTGROUP@,$VIRTGROUP,g" src/remote/libvirtd.rules
|
||||
|
||||
# Since 5.10: "configure: error: Build directory must be different from source directory"
|
||||
mkdir -p build
|
||||
cd build
|
||||
CFLAGS="$SLKCFLAGS" \
|
||||
../configure \
|
||||
--prefix=/usr \
|
||||
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
||||
--bindir=/usr/sbin \
|
||||
--sbindir=/usr/sbin \
|
||||
--sysconfdir=/etc \
|
||||
--localstatedir=/var \
|
||||
--mandir=/usr/man \
|
||||
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
||||
--enable-static=no \
|
||||
--enable-shared=yes \
|
||||
--with-yajl \
|
||||
--with-qemu-group=$VIRTGROUP \
|
||||
--with-init-script=none
|
||||
|
||||
make \
|
||||
HTML_DIR=/usr/doc/$PRGNAM-$VERSION \
|
||||
EXAMPLE_DIR=/usr/doc/$PRGNAM-$VERSION/examples
|
||||
make \
|
||||
HTML_DIR=/usr/doc/$PRGNAM-$VERSION \
|
||||
EXAMPLE_DIR=/usr/doc/$PRGNAM-$VERSION/examples \
|
||||
install-strip DESTDIR=$PKG
|
||||
cd ..
|
||||
|
||||
# we don't have augeas
|
||||
rm -fr $PKG/usr/share/augeas
|
||||
|
||||
# add an rc.libvirt to start/stop/restart the daemon
|
||||
install -D -m 0755 $CWD/rc.libvirt $PKG/etc/rc.d/rc.libvirt.new
|
||||
|
||||
# we use $VIRTGROUP as our virtualization group, fix auth permissions, and
|
||||
# consider the fact that by default we got no certs
|
||||
sed -i \
|
||||
-e "s|^\#unix_sock_group\ =\ \"libvirt\"|unix_sock_group = \"$VIRTGROUP\"|" \
|
||||
-e "s|^\#unix_sock_rw_perms\ =\ \"0770\"|unix_sock_rw_perms = \"0770\"|" \
|
||||
-e "s|^\#auth_unix_ro.*|auth_unix_ro = \"none\"|" \
|
||||
-e "s|^\#auth_unix_rw.*|auth_unix_rw = \"none\"|" \
|
||||
-e "s|^\#listen_tls|listen_tls|" \
|
||||
$PKG/etc/libvirt/libvirtd.conf
|
||||
|
||||
# still, we use $VIRTGROUP as our virtualization group
|
||||
sed -i \
|
||||
-e "s|^\#group\ =\ \"root\"|group = \"$VIRTGROUP\"|" \
|
||||
$PKG/etc/libvirt/qemu.conf
|
||||
|
||||
# disable seccomp support or else VMs won't start with new libvirt/qemu combo
|
||||
sed -i "s|^\#seccomp_sandbox = 1|seccomp_sandbox = 0|" \
|
||||
$PKG/etc/libvirt/qemu.conf
|
||||
|
||||
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
||||
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
|
||||
|
||||
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
||||
cp -a \
|
||||
AUTHORS ChangeLog COPYING* INSTALL README NEWS examples/polkit/* \
|
||||
$PKG/usr/doc/$PRGNAM-$VERSION
|
||||
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
||||
|
||||
mkdir -p $PKG/install
|
||||
cat $CWD/slack-desc > $PKG/install/slack-desc
|
||||
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
||||
|
||||
# Don't clobber existing configuration files
|
||||
for i in etc/libvirt etc/libvirt/nwfilter etc/libvirt/qemu/networks etc/logrotate.d etc/sasl2 etc/sysctl.d; do
|
||||
for j in $(ls -1 $PKG/$i); do
|
||||
if [ ! -d $PKG/$i/$j ]; then
|
||||
mv $PKG/$i/$j $PKG/$i/$j.new
|
||||
echo "config $i/$j.new" >> $PKG/install/doinst.sh
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
cd $PKG
|
||||
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|
@ -0,0 +1,10 @@
|
||||
PRGNAM="libvirt"
|
||||
VERSION="5.10.0"
|
||||
HOMEPAGE="http://libvirt.org"
|
||||
DOWNLOAD="https://libvirt.org/sources/libvirt-5.10.0.tar.xz"
|
||||
MD5SUM="d15aaba3f1e7dc311aacbded48f0dff7"
|
||||
DOWNLOAD_x86_64=""
|
||||
MD5SUM_x86_64=""
|
||||
REQUIRES="yajl"
|
||||
MAINTAINER="Robby Workman"
|
||||
EMAIL="rworkman@slackbuilds.org"
|
@ -0,0 +1,19 @@
|
||||
# HOW TO EDIT THIS FILE:
|
||||
# The "handy ruler" below makes it easier to edit a package description.
|
||||
# Line up the first '|' above the ':' following the base package name, and
|
||||
# the '|' on the right side marks the last column you can put a character in.
|
||||
# You must make exactly 11 lines for the formatting to be correct. It's also
|
||||
# customary to leave one space after the ':' except on otherwise blank lines.
|
||||
|
||||
|-----handy-ruler------------------------------------------------------|
|
||||
libvirt: libvirt (The virtualization API)
|
||||
libvirt:
|
||||
libvirt: libvirt is a toolkit to interact with the virtualization
|
||||
libvirt: capabilities of recent versions of Linux (and other OSes).
|
||||
libvirt:
|
||||
libvirt: Homepage: http://libvirt.org
|
||||
libvirt:
|
||||
libvirt:
|
||||
libvirt:
|
||||
libvirt:
|
||||
libvirt:
|
@ -0,0 +1,26 @@
|
||||
config() {
|
||||
NEW="$1"
|
||||
OLD="$(dirname $NEW)/$(basename $NEW .new)"
|
||||
# If there's no config file by that name, mv it over:
|
||||
if [ ! -r $OLD ]; then
|
||||
mv $NEW $OLD
|
||||
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
|
||||
# toss the redundant copy
|
||||
rm $NEW
|
||||
fi
|
||||
# Otherwise, we leave the .new copy for the admin to consider...
|
||||
}
|
||||
|
||||
preserve_perms() {
|
||||
NEW="$1"
|
||||
OLD="$(dirname $NEW)/$(basename $NEW .new)"
|
||||
if [ -e $OLD ]; then
|
||||
cp -a $OLD ${NEW}.incoming
|
||||
cat $NEW > ${NEW}.incoming
|
||||
mv ${NEW}.incoming $NEW
|
||||
fi
|
||||
config $NEW
|
||||
}
|
||||
|
||||
preserve_perms etc/rc.d/rc.libvirt.new
|
||||
|
@ -0,0 +1,255 @@
|
||||
#!/usr/bin/bash
|
||||
# Init script for libvirtd on Slackware
|
||||
# Written by Matteo Bernardini <ponce@slackbuilds.org>
|
||||
#
|
||||
# Note that a dnsmasq daemon is started by libvirtd itself to serve
|
||||
# its virtual network, and possibly can conflict with a dnsmasq
|
||||
# already running on the system, see
|
||||
# http://wiki.libvirt.org/page/Libvirtd_and_dnsmasq
|
||||
# Note also that the tun, vhost_net and kvm related modules are
|
||||
# automatically loaded at start and removed at stop: edit the
|
||||
# script if this behaviour conflicts with anything else running
|
||||
# on your setup
|
||||
|
||||
MODULES="tun vhost_net"
|
||||
TIMEOUT=${TIMEOUT:-300}
|
||||
LIBVIRTD_PIDFILE="/var/run/libvirt/libvirtd.pid"
|
||||
LIBVIRTD_OPTS=${LIBVIRT_OPTS:-" -f /etc/libvirt/libvirtd.conf -p $LIBVIRTD_PIDFILE "}
|
||||
VIRTLOGD_PIDFILE="/var/run/libvirt/virtlogd.pid"
|
||||
VIRTLOGD_OPTS=${VIRTLOGD_OPTS:-" -f /etc/libvirt/virtlogd.conf -p $VIRTLOGD_PIDFILE "}
|
||||
VIRTLOCKD_PIDFILE="/var/run/libvirt/virtlockd.pid"
|
||||
VIRTLOCKD_OPTS=${VIRTLOCKD_OPTS:-" -f /etc/libvirt/virtlockd.conf -p $VIRTLOCKD_PIDFILE "}
|
||||
|
||||
guests_reboot() {
|
||||
|
||||
for machine in $(/usr/sbin/virsh list --name --state-running | grep -v ^$) ; do
|
||||
/usr/sbin/virsh reboot $machine
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
guests_shutdown() {
|
||||
|
||||
for machine in $(/usr/sbin/virsh list --name --state-running | grep -v ^$) ; do
|
||||
/usr/sbin/virsh shutdown $machine &
|
||||
done
|
||||
|
||||
sleep 2
|
||||
|
||||
echo -n "Waiting for guests to finish shutting down..."
|
||||
|
||||
count=0
|
||||
|
||||
while [ $(/usr/sbin/virsh list --name --state-running | grep -v ^$ | wc -l) -gt "0" ]; do
|
||||
if [ "$count" -ge "$TIMEOUT" ];then
|
||||
break
|
||||
fi
|
||||
echo -n "."
|
||||
count=$(expr $count + 1)
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo ""
|
||||
|
||||
if [ $(/usr/sbin/virsh list --name --state-running | grep -v ^$ | wc -l) -gt "0" ];then
|
||||
|
||||
echo -n "The following guests are still running after $TIMEOUT seconds; destroying them: "
|
||||
for machine in $(/usr/sbin/virsh list --name --state-running | grep -v ^$) ; do
|
||||
/usr/sbin/virsh destroy $machine
|
||||
echo -n "$machine "
|
||||
done
|
||||
|
||||
sleep 2
|
||||
else
|
||||
# add back the seconds we waited before starting the count
|
||||
count=$(expr $count + 2)
|
||||
echo "Shutdown of guests took $count seconds..."
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
|
||||
guests_managedsave() {
|
||||
# apply managedsave on running and paused machines (as we can't distinguish between
|
||||
# the two states while managedsave is being applied, so won't know when to finish waiting)
|
||||
|
||||
for machine in $(/usr/sbin/virsh list --name | grep -v ^$) ; do
|
||||
/usr/sbin/virsh managedsave $machine &
|
||||
done
|
||||
|
||||
sleep 2
|
||||
|
||||
echo -n "Waiting for managedsave to finish on all guests..."
|
||||
|
||||
count=0
|
||||
|
||||
while [ $(/usr/sbin/virsh list --name | grep -v ^$ | wc -l) -gt "0" ]; do
|
||||
if [ "$count" -ge "$TIMEOUT" ];then
|
||||
break
|
||||
fi
|
||||
echo -n "."
|
||||
count=$(expr $count + 1)
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo ""
|
||||
|
||||
if [ $(/usr/sbin/virsh list --name | grep -v ^$ | wc -l) -gt "0" ];then
|
||||
|
||||
echo -n "Following guests are still running after $TIMEOUT seconds, destroying them: "
|
||||
for machine in $(/usr/sbin/virsh list --name | grep -v ^$) ; do
|
||||
/usr/sbin/virsh destroy $machine
|
||||
echo -n "$machine "
|
||||
done
|
||||
|
||||
sleep 2
|
||||
else
|
||||
# add back the seconds we waited before starting the count
|
||||
count=$(expr $count + 2)
|
||||
echo "Guests managed save took $count seconds..."
|
||||
fi
|
||||
}
|
||||
|
||||
check_processor() {
|
||||
|
||||
egrep 'vmx' /proc/cpuinfo > /dev/null
|
||||
|
||||
if [ "$?" -eq "0" ];then
|
||||
MODULES="$MODULES kvm_intel kvm"
|
||||
fi
|
||||
|
||||
check=$?
|
||||
|
||||
egrep 'svm' /proc/cpuinfo > /dev/null
|
||||
|
||||
if [ "$?" -eq "0" ];then
|
||||
MODULES="$MODULES kvm_amd kvm"
|
||||
fi
|
||||
|
||||
check=$(expr $check + $?)
|
||||
|
||||
if [ $check -eq "2" ];then
|
||||
echo "Your system does not support KVM!"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
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 $LIBVIRTD_PIDFILE)
|
||||
check_processor
|
||||
/sbin/modprobe -a $MODULES
|
||||
/usr/sbin/libvirtd -d -l $LIBVIRTD_OPTS
|
||||
}
|
||||
|
||||
stop_libvirtd() {
|
||||
if [ ! -f $LIBVIRTD_PIDFILE ];then
|
||||
echo "libvirt is not running..."
|
||||
exit 2
|
||||
fi
|
||||
guests_managedsave
|
||||
check_processor
|
||||
echo "Stopping libvirtd..."
|
||||
for network in $(/usr/sbin/virsh net-list --name); do
|
||||
/usr/sbin/virsh net-destroy "$network"
|
||||
done
|
||||
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
|
||||
}
|
||||
|
||||
soft_restart() {
|
||||
echo "Soft-restarting libvirt..."
|
||||
if [ ! -f $LIBVIRTD_PIDFILE ];then
|
||||
echo "libvirt is not running..."
|
||||
exit 2
|
||||
fi
|
||||
echo "Stopping libvirtd..."
|
||||
kill -TERM $(cat $LIBVIRTD_PIDFILE)
|
||||
sleep 3
|
||||
stop_virtlogd
|
||||
stop_virtlockd
|
||||
sleep 1
|
||||
start_virtlockd
|
||||
start_virtlogd
|
||||
start_libvirtd
|
||||
}
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
start_virtlockd
|
||||
start_virtlogd
|
||||
start_libvirtd
|
||||
;;
|
||||
stop)
|
||||
stop_libvirtd
|
||||
stop_virtlogd
|
||||
stop_virtlockd
|
||||
;;
|
||||
restart)
|
||||
stop_libvirtd
|
||||
stop_virtlogd
|
||||
stop_virtlockd
|
||||
sleep 2
|
||||
start_virtlockd
|
||||
start_virtlogd
|
||||
start_libvirtd
|
||||
;;
|
||||
soft_restart)
|
||||
soft_restart
|
||||
;;
|
||||
guests_shutdown)
|
||||
guests_shutdown
|
||||
;;
|
||||
guests_reboot)
|
||||
guests_reboot
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 (start|stop|restart|soft_restart|guests_shutdown|guests_reboot)"
|
||||
;;
|
||||
esac
|
||||
|
@ -0,0 +1,15 @@
|
||||
diff -Nur libvirt-4.6.0.orig/src/remote/libvirtd.rules libvirt-4.6.0/src/remote/libvirtd.rules
|
||||
--- libvirt-4.6.0.orig/src/remote/libvirtd.rules 2018-02-26 03:02:18.496310271 -0600
|
||||
+++ libvirt-4.6.0/src/remote/libvirtd.rules 2018-08-12 21:55:35.293691409 -0500
|
||||
@@ -1,9 +1,9 @@
|
||||
-// Allow any user in the 'libvirt' group to connect to system libvirtd
|
||||
+// Allow any user in the '@VIRTGROUP@' group to connect to system libvirtd
|
||||
// without entering a password.
|
||||
|
||||
polkit.addRule(function(action, subject) {
|
||||
if (action.id == "org.libvirt.unix.manage" &&
|
||||
- subject.isInGroup("libvirt")) {
|
||||
+ subject.isInGroup("@VIRTGROUP@")) {
|
||||
return polkit.Result.YES;
|
||||
}
|
||||
});
|
Loading…
Reference in new issue