diff options
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/libvirt/rc.libvirt | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/libraries/libvirt/rc.libvirt b/libraries/libvirt/rc.libvirt index 18cc374059..376dcb0d9b 100644 --- a/libraries/libvirt/rc.libvirt +++ b/libraries/libvirt/rc.libvirt @@ -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 |