]> TLD Linux GIT Repositories - packages/libvirt.git/commitdiff
- TLDized init files
authorMarcin Krol <hawk@tld-linux.org>
Sat, 11 Feb 2017 18:44:28 +0000 (18:44 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Sat, 11 Feb 2017 18:44:28 +0000 (18:44 +0000)
virtlockd.init [new file with mode: 0755]
virtlogd.init [new file with mode: 0755]

diff --git a/virtlockd.init b/virtlockd.init
new file mode 100755 (executable)
index 0000000..6e50e70
--- /dev/null
@@ -0,0 +1,94 @@
+#!/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
diff --git a/virtlogd.init b/virtlogd.init
new file mode 100755 (executable)
index 0000000..ea20eff
--- /dev/null
@@ -0,0 +1,94 @@
+#!/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