]> git.pld-linux.org Git - packages/ganeti.git/blame - ganeti-mond.init
- require network target for ganeti systemd services
[packages/ganeti.git] / ganeti-mond.init
CommitLineData
2b0c5c25
JR
1#!/bin/sh
2#
3# ganeti-mond Start/Stop Ganeti Cluster monitoring daemon.
4#
5# chkconfig: 2345 99 01
6# description: Ganeti Cluster monitoring daemon.
7#
8# processname: ganeti-mond
9# pidfile: /var/run/ganeti/ganeti-mond.pid
10#
11### BEGIN INIT INFO
12# Provides: ganeti-mond
13# Required-Start: $syslog $remote_fs
14# Required-Stop: $syslog $remote_fs
15# Default-Start: 2 3 4 5
16# Default-Stop: 0 1 6
17# Short-Description: Ganeti Cluster monitoring daemon
18# Description: Ganeti Cluster monitoring daemon
19### END INIT INFO
20
21# Source function library.
22. /etc/rc.d/init.d/functions
23
24# Get service config
25[ -f /etc/sysconfig/ganeti ] && . /etc/sysconfig/ganeti
26
27if [ ! -f /var/lib/ganeti/server.pem ]; then
28 echo "Missing configuration file /var/lib/ganeti/server.pem"
29 exit 1
30fi
31
32start() {
33 # Check if the service is already running?
34 if [ -f /var/lock/subsys/ganeti-mond ]; then
35 msg_already_running "Ganeti Cluster monitoring daemon"
36 return
37 fi
38
39 msg_starting "Ganeti Cluster monitoring daemon"
40 @LIBDIR@/ganeti/ensure-dirs
41 daemon --pidfile /var/run/ganeti/ganeti-mond.pid /usr/sbin/ganeti-mond $MOND_ARGS
42 RETVAL=$?
43 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ganeti-mond
44}
45
46stop() {
47 if [ ! -f /var/lock/subsys/ganeti-mond ]; then
48 msg_not_running "Ganeti Cluster monitoring daemon"
49 return
50 fi
51
52 msg_stopping "Ganeti Cluster daemon"
53 killproc --pidfile /var/run/ganeti/ganeti-mond.pid ganeti-mond
54 rm -f /var/lock/subsys/ganeti-mond
55}
56
57# HUP causes daemon to reopen logs only
58reload() {
59 if [ ! -f /var/lock/subsys/ganeti-mond ]; then
60 msg_not_running "Ganeti Cluster monitoring daemon"
61 RETVAL=7
62 return
63 fi
64
65 msg_reloading "Ganeti Cluster monitoring daemon"
66 killproc ganeti-mond -HUP
67 RETVAL=$?
68}
69
70condrestart() {
71 if [ ! -f /var/lock/subsys/ganeti-mond ]; then
72 msg_not_running "Ganeti Cluster monitoring daemon"
73 RETVAL=$1
74 return
75 fi
76
77 stop
78 start
79}
80
81RETVAL=0
82# See how we were called.
83case "$1" in
84 start)
85 start
86 ;;
87 stop)
88 stop
89 ;;
90 restart)
91 stop
92 start
93 ;;
94 try-restart)
95 condrestart 0
96 ;;
97 reload|force-reload|flush-logs)
98 reload
99 ;;
100 status)
101 status --pidfile /var/run/ganeti/ganeti-mond.pid ganeti-mond
102 exit $?
103 ;;
104 *)
105 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|flush-logs|status}"
106 exit 3
107esac
108
109exit $RETVAL
This page took 0.09834 seconds and 4 git commands to generate.