Not all libvirt initscripts are installed on Debian. Only install
libvirt-guests and virtlockd on Fedora and CentOS.
Also remove the check on the existence of initscripts from
start_initscripts/stop_initscripts.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
function start_initscripts() {
while test $# -ge 1
do
- if test ! -f $1
- then
- shift 1
- continue
- fi
case $DISTRO in
"Debian" )
$SUDO update-rc.d $1 defaults || echo "Couldn't set $1 to start"
function stop_initscripts() {
while test $# -ge 1
do
- if test ! -f $1
- then
- shift 1
- continue
- fi
case $DISTRO in
"Debian" )
$SUDO update-rc.d $1 remove || echo "Couldn't remove $1 from init"
}
function libvirt_configure() {
- start_initscripts libvirtd libvirt-guests virtlockd
+ start_initscripts libvirtd
+ if test $DISTRO = "Fedora" || test $DISTRO = "CentOS"
+ then
+ start_initscripts libvirt-guests virtlockd
+ fi
}
function libvirt_unconfigure() {
- stop_initscripts libvirtd libvirt-guests virtlockd
+ stop_initscripts libvirtd
+ if test $DISTRO = "Fedora" || test $DISTRO = "CentOS"
+ then
+ stop_initscripts libvirt-guests virtlockd
+ fi
}