libraries/libvirt: Added soft_restart() to rc.libvirt
With this patch, "rc.libvirt soft_restart" will kill and restart the libvirt services without affecting any running virtual machines. This has been a necessity for the SBo infrastructure given our recent struggles with libvirt losing dbus connectivity without explanation. Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
This commit is contained in:
parent
277ff139e9
commit
b459b3623f
|
@ -188,6 +188,23 @@ stop_virtlockd() {
|
|||
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
|
||||
|
@ -208,6 +225,9 @@ restart)
|
|||
start_virtlogd
|
||||
start_libvirtd
|
||||
;;
|
||||
soft_restart)
|
||||
soft_restart
|
||||
;;
|
||||
guests_shutdown)
|
||||
guests_shutdown
|
||||
;;
|
||||
|
@ -215,7 +235,7 @@ guests_reboot)
|
|||
guests_reboot
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 (start|stop|restart|guests_shutdown|guests_reboot)"
|
||||
echo "Usage: $0 (start|stop|restart|soft_restart|guests_shutdown|guests_reboot)"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
|
Loading…
Reference in New Issue