2007-08-21 02:37:22 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# the following is the LSB init header see
|
|
|
|
# http://www.linux-foundation.org/spec//booksets/LSB-Core-generic/LSB-Core-generic.html#INITSCRCOMCONV
|
|
|
|
#
|
|
|
|
### BEGIN INIT INFO
|
|
|
|
# Provides: libvirtd
|
2009-01-12 02:05:34 +01:00
|
|
|
# Required-Start: $network $remote_fs
|
2011-08-25 04:34:20 +02:00
|
|
|
# Should-Start: xend cgconfig
|
2007-08-21 02:37:22 +02:00
|
|
|
# Default-Start: 3 5
|
2009-01-12 02:05:34 +01:00
|
|
|
# Required-Stop: $network $remote_fs
|
2011-08-25 04:34:20 +02:00
|
|
|
# Should-Stop: xend cgconfig
|
2007-08-21 02:37:22 +02:00
|
|
|
# Default-Stop: 0 1 2 4 6
|
|
|
|
# Short-Description: daemon for libvirt virtualization API
|
|
|
|
# Description: This is a daemon for managing QEMU guest instances
|
|
|
|
# and libvirt virtual networks
|
|
|
|
# See http://libvirt.org
|
|
|
|
### END INIT INFO
|
|
|
|
|
|
|
|
|
|
|
|
LIBVIRTD_BIN=/usr/sbin/libvirtd
|
2010-10-14 01:46:24 +02:00
|
|
|
LIBVIRTD_PIDFILE=/var/run/libvirtd.pid
|
2007-08-21 02:37:22 +02:00
|
|
|
test -x $LIBVIRTD_BIN || { echo "$LIBVIRD_BIN not installed";
|
|
|
|
if [ "$1" = "stop" ]; then exit 0;
|
|
|
|
else exit 5; fi; }
|
|
|
|
|
|
|
|
|
|
|
|
. /etc/rc.status
|
|
|
|
rc_reset
|
|
|
|
|
- Update to libvirt 1.0.1
- Introduce virtlockd daemon
- parallels: add disk and network device support
- Add virDomainSendProcessSignal API
- Introduce virDomainFSTrim() public API
- add fuse support for libvirt lxc
- Add Gluster protocol as supported network disk backend
- various snapshot improvements
- Add upstream patches to fix bugs in 1.0.1
66ff2ddc-virtlockd-systemd-file-perms.patch,
462a6962-script-fixes1.patch, cb854b8f-script-fixes2.patch,
5ec4b22b-script-fixes3.patch, a1fd56cb-script-fixes4.patch,
68e7bc45-libxl-link-fix.patch
- Rework SUSE patches for the various init scripts
Dropped use-init-script-redhat.patch and added
libvirtd-init-script.patch, libvirt-guests-init-script.patch,
and virtlockd-init-script.patch
- Drop upstream patches: 371ddc98-xen-sysctl-9.patch,
416eca18-xenstore-header-fix.patch,
f644361b-virCommand-env.patch, 2b32735a-virCommand-env.patch,
9785f2b6-fix-xen-sysctl9.patch
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=238
2013-01-07 19:44:26 +01:00
|
|
|
test -f /etc/sysconfig/libvirtd && . /etc/sysconfig/libvirtd
|
|
|
|
|
|
|
|
LIBVIRTD_CONFIG_ARGS=
|
|
|
|
if [ -n "$LIBVIRTD_CONFIG" ]
|
|
|
|
then
|
|
|
|
LIBVIRTD_CONFIG_ARGS="--config $LIBVIRTD_CONFIG"
|
|
|
|
fi
|
2007-08-21 02:37:22 +02:00
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
2010-10-14 01:46:24 +02:00
|
|
|
if [ -e $LIBVIRTD_PIDFILE ]; then
|
|
|
|
if checkproc $LIBVIRTD_BIN ; then
|
|
|
|
echo -n "libvirtd is already running."
|
|
|
|
rc_status -v
|
|
|
|
exit
|
|
|
|
else
|
|
|
|
echo "Removing stale PID file $LIBVIRTD_PIDFILE."
|
|
|
|
rm -f $LIBVIRTD_PIDFILE
|
|
|
|
fi
|
|
|
|
fi
|
2007-08-21 02:37:22 +02:00
|
|
|
echo -n "Starting libvirtd "
|
- Update to libvirt 1.0.1
- Introduce virtlockd daemon
- parallels: add disk and network device support
- Add virDomainSendProcessSignal API
- Introduce virDomainFSTrim() public API
- add fuse support for libvirt lxc
- Add Gluster protocol as supported network disk backend
- various snapshot improvements
- Add upstream patches to fix bugs in 1.0.1
66ff2ddc-virtlockd-systemd-file-perms.patch,
462a6962-script-fixes1.patch, cb854b8f-script-fixes2.patch,
5ec4b22b-script-fixes3.patch, a1fd56cb-script-fixes4.patch,
68e7bc45-libxl-link-fix.patch
- Rework SUSE patches for the various init scripts
Dropped use-init-script-redhat.patch and added
libvirtd-init-script.patch, libvirt-guests-init-script.patch,
and virtlockd-init-script.patch
- Drop upstream patches: 371ddc98-xen-sysctl-9.patch,
416eca18-xenstore-header-fix.patch,
f644361b-virCommand-env.patch, 2b32735a-virCommand-env.patch,
9785f2b6-fix-xen-sysctl9.patch
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=238
2013-01-07 19:44:26 +01:00
|
|
|
mkdir -p /var/cache/libvirt
|
|
|
|
rm -rf /var/cache/libvirt/*
|
|
|
|
# LIBVIRTD_NOFILES_LIMIT from /etc/sysconfig/libvirtd is not handled
|
|
|
|
# automatically
|
|
|
|
if [ -n "$LIBVIRTD_NOFILES_LIMIT" ]; then
|
|
|
|
ulimit -n "$LIBVIRTD_NOFILES_LIMIT"
|
|
|
|
fi
|
|
|
|
startproc $LIBVIRTD_BIN --daemon $LIBVIRTD_CONFIG_ARGS $LIBVIRTD_ARGS
|
2007-08-21 02:37:22 +02:00
|
|
|
rc_status -v
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
echo -n "Shutting down libvirtd "
|
- Update to libvirt 1.0.1
- Introduce virtlockd daemon
- parallels: add disk and network device support
- Add virDomainSendProcessSignal API
- Introduce virDomainFSTrim() public API
- add fuse support for libvirt lxc
- Add Gluster protocol as supported network disk backend
- various snapshot improvements
- Add upstream patches to fix bugs in 1.0.1
66ff2ddc-virtlockd-systemd-file-perms.patch,
462a6962-script-fixes1.patch, cb854b8f-script-fixes2.patch,
5ec4b22b-script-fixes3.patch, a1fd56cb-script-fixes4.patch,
68e7bc45-libxl-link-fix.patch
- Rework SUSE patches for the various init scripts
Dropped use-init-script-redhat.patch and added
libvirtd-init-script.patch, libvirt-guests-init-script.patch,
and virtlockd-init-script.patch
- Drop upstream patches: 371ddc98-xen-sysctl-9.patch,
416eca18-xenstore-header-fix.patch,
f644361b-virCommand-env.patch, 2b32735a-virCommand-env.patch,
9785f2b6-fix-xen-sysctl9.patch
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=238
2013-01-07 19:44:26 +01:00
|
|
|
rm -f /var/lock/subsys/libvirtd
|
|
|
|
rm -rf /var/cache/libvirt/*
|
2007-08-21 02:37:22 +02:00
|
|
|
killproc -TERM $LIBVIRTD_BIN > /dev/null 2>&1
|
2010-10-14 01:46:24 +02:00
|
|
|
rm -f $LIBVIRTD_PIDFILE
|
2007-08-21 02:37:22 +02:00
|
|
|
rc_status -v
|
|
|
|
;;
|
|
|
|
try-restart)
|
|
|
|
$0 status >/dev/null && $0 restart
|
|
|
|
rc_status
|
|
|
|
;;
|
|
|
|
restart)
|
|
|
|
$0 stop
|
|
|
|
$0 start
|
|
|
|
rc_status
|
|
|
|
;;
|
|
|
|
reload)
|
|
|
|
killproc -HUP $LIBVIRTD_BIN
|
|
|
|
rc_status -v
|
|
|
|
;;
|
|
|
|
status)
|
|
|
|
echo -n "Checking status of libvirtd "
|
|
|
|
checkproc $LIBVIRTD_BIN
|
|
|
|
rc_status -v
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Usage: $0 {start|stop|restart|try-restart|reload|status}"
|
|
|
|
rc_failed 2
|
|
|
|
rc_exit
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
rc_exit
|