]> git.pld-linux.org Git - packages/libvirt.git/blame - libvirt.init
- pl
[packages/libvirt.git] / libvirt.init
CommitLineData
e6545db1
SP
1#!/bin/sh
2# libvirtd: guest and virtual network management daemon
3#
4# chkconfig: 345 97 03
5# description: This is a daemon for managing guest instances
6# and libvirt virtual networks
7# See http://libvirt.org
8#
9# processname: libvirtd
10#
11
12LIBVIRTD_CONFIG=
13LIBVIRTD_ARGS=
14
15LIBVIRTD_CONFIG_ARGS=
16if [ -n "$LIBVIRTD_CONFIG" ]
17then
18 LIBVIRTD_CONFIG_ARGS="--config $LIBVIRTD_CONFIG"
19fi
20
21# Source function library.
22. /etc/rc.d/init.d/functions
23
24sconf="/etc/libvirt/libvirtd.conf"
25
26# Source config
27if [ -f /etc/sysconfig/libvirtd ] ; then
28 . /etc/sysconfig/libvirtd
29fi
30
31
32start() {
33 if [ ! -f /var/lock/subsys/libvirtd ]; then
34 umask 077
35 msg_starting libvirtd
3f3de736 36 daemon libvirtd libvirtd --daemon $LIBVIRTD_CONFIG_ARGS $LIBVIRTD_ARGS
e6545db1
SP
37 RETVAL=$?
38 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/libvirtd
39 else
40 msg_already_running libvirtd
41 fi
42}
43
44stop() {
45 if [ -f /var/lock/subsys/libvirtd ]; then
46 msg_stopping libvirtd
47 killproc libvirtd
48 rm -f /var/lock/subsys/libvirtd
49 else
50 msg_not_running libvirtd
51 fi
52}
53
54condrestart() {
55 if [ -f /var/lock/subsys/libvirtd ]; then
56 stop
57 start
58 else
59 msg_not_running libvirtd
60 RETVAL=$1
61 fi
62}
63
64RETVAL=0
65case "$1" in
66 start)
67 start
68 ;;
69 stop)
70 stop
71 ;;
72 restart)
73 stop
74 start
75 ;;
76 try-restart)
77 condrestart 0
78 ;;
79 status)
80 status libvirtd
81 ;;
82 *)
83 msg_usage "$0 {start|stop|restart|try-restart|status}"
84 exit 3
85esac
86
87exit $RETVAL
This page took 0.060113 seconds and 4 git commands to generate.