@@ -45,7 +45,7 @@ echowarn() {
45
45
# DESCRIPTION: Echo debug information to stdout.
46
46
# -------------------------------------------------------------------------------
47
47
echodebug () {
48
- if [ " $_ECHO_DEBUG " -eq " $BS_TRUE " ]; then
48
+ if [ $_ECHO_DEBUG -eq $BS_TRUE ]; then
49
49
printf " ${BC} * DEBUG${EC} : %s\n" " $@ " ;
50
50
fi
51
51
}
@@ -342,7 +342,7 @@ __check_end_of_life_versions() {
342
342
;;
343
343
344
344
centos)
345
- # CentOS versions lower than 5 are no longer supported
345
+ # CentOS versions lower than 6 are no longer supported
346
346
if { [ " $DISTRO_MAJOR_VERSION " -eq 6 ] && [ " $DISTRO_MINOR_VERSION " -lt 3 ]; } || [ " $DISTRO_MAJOR_VERSION " -lt 5 ]; then
347
347
echoerror " End of life distributions are not supported."
348
348
echoerror " Please consider upgrading to the next stable. See:"
@@ -374,26 +374,32 @@ __check_end_of_life_versions
374
374
# CentOS Install Functions
375
375
#
376
376
install_centos () {
377
- if [ " $DISTRO_MAJOR_VERSION " -ge 6 ]; then
378
- yum -y install qemu-kvm libvirt bridge-utils python-libguestfs libguestfs-tools supervisor cyrus-sasl-md5 epel-release || return 1
377
+ yum -y install epel-release || return 1
378
+
379
+ if [ " $DISTRO_MAJOR_VERSION " -lt 8 ]; then
380
+ yum -y install qemu-kvm libvirt bridge-utils python-libguestfs libguestfs-tools supervisor cyrus-sasl-md5 || return 1
381
+ else
382
+ yum -y install qemu-kvm libvirt python3-libguestfs libguestfs-tools cyrus-sasl-md5 supervisor || return 1
379
383
fi
380
384
return 0
381
385
}
382
386
383
387
install_centos_post () {
384
- if [ -f /etc/sysconfig/libvirtd ]; then
385
- sed -i ' s/#LIBVIRTD_ARGS/LIBVIRTD_ARGS/g' /etc/sysconfig/libvirtd
386
- else
387
- echoerror " /etc/sysconfig/libvirtd not found. Exiting..."
388
- exit 1
389
- fi
390
- if [ -f /etc/libvirt/libvirtd.conf ]; then
391
- sed -i ' s/#listen_tls/listen_tls/g' /etc/libvirt/libvirtd.conf
392
- sed -i ' s/#listen_tcp/listen_tcp/g' /etc/libvirt/libvirtd.conf
393
- sed -i ' s/#auth_tcp/auth_tcp/g' /etc/libvirt/libvirtd.conf
394
- else
395
- echoerror " /etc/libvirt/libvirtd.conf not found. Exiting..."
396
- exit 1
388
+ if [ " $DISTRO_MAJOR_VERSION " -lt 8 ]; then
389
+ if [ -f /etc/sysconfig/libvirtd ]; then
390
+ sed -i ' s/#LIBVIRTD_ARGS/LIBVIRTD_ARGS/g' /etc/sysconfig/libvirtd
391
+ else
392
+ echoerror " /etc/sysconfig/libvirtd not found. Exiting..."
393
+ exit 1
394
+ fi
395
+ if [ -f /etc/libvirt/libvirtd.conf ]; then
396
+ sed -i ' s/#listen_tls/listen_tls/g' /etc/libvirt/libvirtd.conf
397
+ sed -i ' s/#listen_tcp/listen_tcp/g' /etc/libvirt/libvirtd.conf
398
+ sed -i ' s/#auth_tcp/auth_tcp/g' /etc/libvirt/libvirtd.conf
399
+ else
400
+ echoerror " /etc/libvirt/libvirtd.conf not found. Exiting..."
401
+ exit 1
402
+ fi
397
403
fi
398
404
if [ -f /etc/libvirt/qemu.conf ]; then
399
405
sed -i ' s/#[ ]*vnc_listen.*/vnc_listen = "0.0.0.0"/g' /etc/libvirt/qemu.conf
@@ -440,14 +446,24 @@ daemons_running_centos() {
440
446
service libvirt-guests stop > /dev/null 2>&1
441
447
service libvirt-guests start
442
448
fi
443
- if [ -f /usr/lib/systemd/system/libvirtd.service ]; then
444
- systemctl stop libvirtd.service > /dev/null 2>&1
445
- systemctl start libvirtd.service
449
+
450
+ if [ " $DISTRO_MAJOR_VERSION " -lt 8 ]; then
451
+ if [ -f /usr/lib/systemd/system/libvirtd.service ]; then
452
+ systemctl stop libvirtd.service > /dev/null 2>&1
453
+ systemctl start libvirtd.service
454
+ fi
455
+ else
456
+ if [ -f /usr/lib/systemd/system/libvirtd-tcp.socket ]; then
457
+ systemctl stop libvirtd-tcp.socket > /dev/null 2>&1
458
+ systemctl start libvirtd-tcp.socket
459
+ fi
446
460
fi
461
+
447
462
if [ -f /usr/lib/systemd/system/libvirt-guests.service ]; then
448
463
systemctl stop libvirt-guests.service > /dev/null 2>&1
449
464
systemctl start libvirt-guests.service
450
465
fi
466
+
451
467
if [ -f /etc/init.d/supervisord ]; then
452
468
service supervisord stop > /dev/null 2>&1
453
469
service supervisord start
@@ -599,7 +615,6 @@ install_ubuntu() {
599
615
apt install -y qemu-kvm libvirt-bin bridge-utils virt-manager sasl2-bin python3-guestfs supervisor || return 1
600
616
fi
601
617
602
-
603
618
return 0
604
619
}
605
620
0 commit comments