]> git.pld-linux.org Git - packages/libvirt.git/commitdiff
- new
authorSÅ‚awomir Paszkiewicz <paszczus@pld-linux.org>
Wed, 24 Sep 2008 11:54:50 +0000 (11:54 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    libvirt.init -> 1.1

libvirt.init [new file with mode: 0644]

diff --git a/libvirt.init b/libvirt.init
new file mode 100644 (file)
index 0000000..23b4cbd
--- /dev/null
@@ -0,0 +1,87 @@
+#!/bin/sh
+# libvirtd:   guest and virtual network management daemon
+#
+# chkconfig: 345 97 03
+# description:  This is a daemon for managing guest instances
+#               and libvirt virtual networks
+#               See http://libvirt.org
+#
+# processname: libvirtd
+#
+
+LIBVIRTD_CONFIG=
+LIBVIRTD_ARGS=
+
+LIBVIRTD_CONFIG_ARGS=
+if [ -n "$LIBVIRTD_CONFIG" ]
+then
+    LIBVIRTD_CONFIG_ARGS="--config $LIBVIRTD_CONFIG"
+fi
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+sconf="/etc/libvirt/libvirtd.conf"
+
+# Source config
+if [ -f /etc/sysconfig/libvirtd ] ; then
+        . /etc/sysconfig/libvirtd
+fi
+
+
+start() {
+        if [ ! -f /var/lock/subsys/libvirtd ]; then
+                umask 077
+                msg_starting libvirtd
+                daemon --check libvirtd libvirtd --daemon $LIBVIRTD_CONFIG_ARGS $LIBVIRTD_ARGS
+                RETVAL=$?
+                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/libvirtd
+        else
+                msg_already_running libvirtd
+        fi
+}
+
+stop() {
+        if [ -f /var/lock/subsys/libvirtd ]; then
+                msg_stopping libvirtd
+                killproc libvirtd
+                rm -f /var/lock/subsys/libvirtd
+        else
+                msg_not_running libvirtd
+        fi
+}
+
+condrestart() {
+        if [ -f /var/lock/subsys/libvirtd ]; then
+                stop
+                start
+        else
+                msg_not_running libvirtd
+                RETVAL=$1
+        fi
+}
+
+RETVAL=0
+case "$1" in
+  start)
+        start
+        ;;
+  stop)
+        stop
+        ;;
+  restart)
+        stop
+        start
+        ;;
+  try-restart)
+        condrestart 0
+        ;;
+  status)
+        status libvirtd
+        ;;
+  *)
+        msg_usage "$0 {start|stop|restart|try-restart|status}"
+        exit 3
+esac
+
+exit $RETVAL
This page took 0.167186 seconds and 4 git commands to generate.