#! /bin/sh # # Init script for libvirtd # # Loosely based on Debian libvirt-bin initscript: # (c) 2007 Guido Guenther # based on the skeletons that comes with dh_make # ### BEGIN INIT INFO # Provides: libvirt-bin libvirtd # Required-Start: $network $local_fs $remote_fs $syslog xenstored # Required-Stop: $local_fs $remote_fs $syslog xenstored # Should-Start: avahi-daemon cgconfig # Should-Stop: avahi-daemon cgconfig # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: libvirt management daemon ### END INIT INFO PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin export PATH DAEMON=/usr/local/sbin/libvirtd NAME=libvirtd DESC="libvirt management daemon" test -x $DAEMON || exit 0 . /lib/lsb/init-functions PIDFILE=/var/run/$NAME.pid start() { ulimit -c unlimited start-stop-daemon --start --pidfile $PIDFILE \ --exec $DAEMON $@ -- -d $libvirtd_opts } stop() { start-stop-daemon --stop --pidfile $PIDFILE \ --exec $DAEMON $@ } case "$1" in start) [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" start [ "$VERBOSE" != no ] && log_end_msg $? ;; stop) [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" stop [ "$VERBOSE" != no ] && log_end_msg $? ;; restart) [ "$VERBOSE" != no ] && log_daemon_msg "Restarting $DESC" "$DAEMON" stop --oknodo start [ "$VERBOSE" != no ] && log_end_msg $? ;; reload|force-reload) start-stop-daemon --stop --signal 1 --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON ;; *) N=/etc/init.d/libvirtd echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 exit 1 ;; esac exit 0