1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

Merge branch 'guestfish'

This commit is contained in:
Retspen 2015-05-21 15:08:21 +03:00
commit 56b1cdc518
7 changed files with 205 additions and 8 deletions

View file

@ -375,7 +375,7 @@ __check_end_of_life_versions
#
install_centos() {
if [ $DISTRO_MAJOR_VERSION -ge 6 ]; then
yum -y install qemu-kvm libvirt bridge-utils || return 1
yum -y install qemu-kvm libvirt bridge-utils python-libguestfs supervisor || return 1
fi
return 0
}
@ -401,6 +401,25 @@ install_centos_post() {
echoerror "/etc/libvirt/qemu.conf not found. Exiting..."
exit 1
fi
if [ $DISTRO_MAJOR_VERSION -lt 7 ]; then
if [ -f /etc/supervisord.conf ]; then
curl https://raw.githubusercontent.com/retspen/webvirtcloud/master/conf/daemon/gstfsd > /usr/local/bin/gstfsd
chmod +x /usr/local/bin/gstfsd
curl https://raw.githubusercontent.com/retspen/webvirtcloud/master/conf/supervisor/gstfsd.conf >> /etc/supervisor.conf
else
echoerror "Supervisor not found. Exiting..."
exit 1
fi
else
if [ -f /etc/supervisord.conf ]; then
curl https://raw.githubusercontent.com/retspen/webvirtcloud/master/conf/daemon/gstfsd > /usr/local/bin/gstfsd
chmod +x /usr/local/bin/gstfsd
curl https://raw.githubusercontent.com/retspen/webvirtcloud/master/conf/supervisor/gstfsd.conf > /etc/supervisor.d/gstfsd.ini
else
echoerror "Supervisor not found. Exiting..."
exit 1
fi
fi
return 0
}
@ -421,6 +440,14 @@ daemons_running_centos() {
systemctl stop libvirt-guests.service > /dev/null 2>&1
systemctl start libvirt-guests.service
fi
if [ -f /etc/init.d/supervisord ]; then
service supervisord stop > /dev/null 2>&1
service supervisord start
fi
if [ -f /usr/lib/systemd/system/supervisord.service ]; then
systemctl stop supervisord.service > /dev/null 2>&1
systemctl start supervisord.service
fi
return 0
}
#
@ -433,7 +460,7 @@ daemons_running_centos() {
# Fedora Install Functions
#
install_fedora() {
yum -y install kvm libvirt bridge-utils || return 1
yum -y install kvm libvirt bridge-utils python-libguestfs supervisor || return 1
return 0
}
@ -458,6 +485,14 @@ install_fedora_post() {
echoerror "/etc/libvirt/qemu.conf not found. Exiting..."
exit 1
fi
if [ -f /etc/supervisord.conf ]; then
curl https://raw.githubusercontent.com/retspen/webvirtcloud/master/conf/daemon/gstfsd > /usr/local/bin/gstfsd
chmod +x /usr/local/bin/gstfsd
curl https://raw.githubusercontent.com/retspen/webvirtcloud/master/conf/supervisor/gstfsd.conf > /etc/supervisor.d/gstfsd.ini
else
echoerror "Supervisor not found. Exiting..."
exit 1
fi
return 0
}
@ -470,6 +505,10 @@ daemons_running_fedora() {
systemctl stop libvirt-guests.service > /dev/null 2>&1
systemctl start libvirt-guests.service
fi
if [ -f /usr/lib/systemd/system/supervisord.service ]; then
systemctl stop supervisord.service > /dev/null 2>&1
systemctl start supervisord.service
fi
return 0
}
#
@ -482,7 +521,7 @@ daemons_running_fedora() {
# Opensuse Install Functions
#
install_opensuse() {
zypper -n install -l kvm libvirt bridge-utils || return 1
zypper -n install -l kvm libvirt bridge-utils python-libguestfs supervisor || return 1
return 0
}
@ -507,6 +546,14 @@ install_opensuse_post() {
echoerror "/etc/libvirt/qemu.conf not found. Exiting..."
exit 1
fi
if [ -f /etc/supervisord.conf ]; then
curl https://raw.githubusercontent.com/retspen/webvirtcloud/master/conf/daemon/gstfsd > /usr/local/bin/gstfsd
chmod +x /usr/local/bin/gstfsd
curl https://raw.githubusercontent.com/retspen/webvirtcloud/master/conf/supervisor/gstfsd.conf > /etc/supervisor.d/gstfsd.ini
else
echoerror "Supervisor not found. Exiting..."
exit 1
fi
return 0
}
@ -519,6 +566,10 @@ daemons_running_opensuse() {
systemctl stop libvirt-guests.service > /dev/null 2>&1
systemctl start libvirt-guests.service
fi
if [ -f /usr/lib/systemd/system/supervisord.service ]; then
systemctl stop supervisord.service > /dev/null 2>&1
systemctl start supervisord.service
fi
return 0
}
#
@ -532,7 +583,7 @@ daemons_running_opensuse() {
#
install_ubuntu() {
apt-get update || return 1
apt-get -y install kvm libvirt-bin bridge-utils sasl2-bin || return 1
apt-get -y install kvm libvirt-bin bridge-utils sasl2-bin python-guestfs supervisor || return 1
return 0
}
@ -561,6 +612,14 @@ install_ubuntu_post() {
echoerror "/etc/libvirt/qemu.conf not found. Exiting..."
exit 1
fi
if [ -f /etc/supervisor/supervisord.conf ]; then
wget -O /usr/local/bin/gstfsd https://raw.githubusercontent.com/retspen/webvirtcloud/master/conf/daemon/gstfsd
chmod +x /usr/local/bin/gstfsd
wget -O /etc/supervisor/conf.d/gstfsd.conf https://raw.githubusercontent.com/retspen/webvirtcloud/master/conf/supervisor/gstfsd.conf
else
echoerror "Supervisor not found. Exiting..."
exit 1
fi
return 0
}
@ -570,6 +629,11 @@ daemons_running_ubuntu() {
service libvirt-bin stop > /dev/null 2>&1
service libvirt-bin start
fi
if [ -f /etc/init.d/supervisor ]; then
# Still in SysV init!?
service supervisor stop > /dev/null 2>&1
service supervisor start
fi
return 0
}
#
@ -583,7 +647,7 @@ daemons_running_ubuntu() {
#
install_debian() {
apt-get update || return 1
apt-get -y install kvm libvirt-bin bridge-utils sasl2-bin || return 1
apt-get -y install kvm libvirt-bin bridge-utils sasl2-bin python-guestfs supervisor || return 1
return 0
}
@ -619,6 +683,14 @@ install_debian_post() {
echoerror "/etc/libvirt/qemu.conf not found. Exiting..."
exit 1
fi
if [ -f /etc/supervisor/supervisord.conf ]; then
wget -O /usr/local/bin/gstfsd https://raw.githubusercontent.com/retspen/webvirtcloud/master/conf/daemon/gstfsd
chmod +x /usr/local/bin/gstfsd
wget -O /etc/supervisor/conf.d/gstfsd.conf https://raw.githubusercontent.com/retspen/webvirtcloud/master/conf/supervisor/gstfsd.conf
else
echoerror "Supervisor not found. Exiting..."
exit 1
fi
return 0
}
@ -632,6 +704,10 @@ daemons_running_debian() {
/etc/init.d/$LIBVIRTSVC stop > /dev/null 2>&1
/etc/init.d/$LIBVIRTSVC start
fi
if [ -f /etc/init.d/supervisor ]; then
service supervisor stop > /dev/null 2>&1
service supervisor start
fi
return 0
}
#