--- /dev/null
+#!/bin/bash
+
+# virtlockd: virtual machine lock manager
+#
+# chkconfig: 345 96 04
+# description: This is a daemon for managing locks
+# on virtual machine disk images
+#
+# processname: virtlockd
+#
+
+VIRTLOCKD_ARGS=
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+# Source config
+if [ -f /etc/sysconfig/virtlockd ] ; then
+ . /etc/sysconfig/virtlockd
+fi
+
+start() {
+ if [ -f /var/lock/subsys/virtlockd ]; then
+ msg_already_running "virtlockd"
+ return
+ fi
+
+ umask 077
+ msg_starting "virtlockd"
+ daemon /usr/sbin/virtlockd --daemon $VIRTLOCKD_CONFIG_ARGS $VIRTLOCKD_ARGS
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/virtlockd
+}
+
+stop() {
+ if [ ! -f /var/lock/subsys/virtlockd ]; then
+ msg_not_running "virtlockd"
+ return
+ fi
+
+ msg_stopping "virtlockd"
+ killproc virtlockd
+ rm -f /var/lock/subsys/virtlockd
+}
+
+
+reload() {
+ if [ ! -f /var/lock/subsys/virtlockd ]; then
+ msg_not_running "virtlockd"
+ RETVAL=7
+ return
+ fi
+
+ msg_reloading virtlockd
+ killproc virtlockd -HUP
+ RETVAL=$?
+}
+
+condrestart() {
+ if [ ! -f /var/lock/subsys/virtlockd ]; then
+ msg_not_running "virtlockd"
+ RETVAL=$1
+ return
+ fi
+ stop
+ start
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ try-restart)
+ condrestart 0
+ ;;
+ reload|force-reload)
+ reload
+ ;;
+ status)
+ status libvirtd
+ ;;
+ *)
+ msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
+ exit 3
+esac
+exit $RETVAL
--- /dev/null
+#!/bin/bash
+
+# virtlogd: virtual machine log manager
+#
+# chkconfig: 345 96 04
+# description: This is a daemon for managing logs
+# of virtual machine consoles
+#
+# processname: virtlogd
+#
+
+VIRTLOGD_ARGS=
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+# Source config
+if [ -f /etc/sysconfig/virtlogd ] ; then
+ . /etc/sysconfig/virtlogd
+fi
+
+start() {
+ if [ -f /var/lock/subsys/virtlogd ]; then
+ msg_already_running "virtlogd"
+ return
+ fi
+
+ umask 077
+ msg_starting "virtlogd"
+ daemon /usr/sbin/virtlogd --daemon $VIRTLOGD_CONFIG_ARGS $VIRTLOGD_ARGS
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/virtlogd
+}
+
+stop() {
+ if [ ! -f /var/lock/subsys/virtlogd ]; then
+ msg_not_running "virtlogd"
+ return
+ fi
+
+ msg_stopping "virtlogd"
+ killproc virtlogd
+ rm -f /var/lock/subsys/virtlogd
+}
+
+
+reload() {
+ if [ ! -f /var/lock/subsys/virtlogd ]; then
+ msg_not_running "virtlogd"
+ RETVAL=7
+ return
+ fi
+
+ msg_reloading virtlogd
+ killproc virtlogd -HUP
+ RETVAL=$?
+}
+
+condrestart() {
+ if [ ! -f /var/lock/subsys/virtlogd ]; then
+ msg_not_running "virtlogd"
+ RETVAL=$1
+ return
+ fi
+ stop
+ start
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ try-restart)
+ condrestart 0
+ ;;
+ reload|force-reload)
+ reload
+ ;;
+ status)
+ status libvirtd
+ ;;
+ *)
+ msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
+ exit 3
+esac
+exit $RETVAL