]> git.pld-linux.org Git - packages/ganeti.git/blame - ganeti-masterd.init
- run daemons as root for now
[packages/ganeti.git] / ganeti-masterd.init
CommitLineData
bc935a7a
JR
1#!/bin/sh
2#
3# ganeti-masterd Start/Stop Ganeti Cluster master daemon.
4#
5# chkconfig: 2345 97 03
6# description: Ganeti Cluster master daemon.
7#
8# processname: ganeti-masterd
9# pidfile: /var/run/ganeti/ganeti-masterd.pid
10#
11### BEGIN INIT INFO
12# Provides: ganeti-masterd
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 master daemon
18# Description: Ganeti Cluster master 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-masterd ]; then
35 msg_already_running "Ganeti Cluster master daemon"
36 return
37 fi
38
39 msg_starting "Ganeti Cluster master daemon"
848d0038 40 daemon --pidfile /var/run/ganeti/ganeti-masterd.pid /usr/sbin/ganeti-masterd $MASTERD_ARGS
bc935a7a
JR
41 RETVAL=$?
42 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ganeti-masterd
43}
44
45stop() {
46 if [ ! -f /var/lock/subsys/ganeti-masterd ]; then
47 msg_not_running "Ganeti Cluster master daemon"
48 return
49 fi
50
51 msg_stopping "Ganeti Cluster master daemon"
52 killproc --pidfile /var/run/ganeti/ganeti-masterd.pid ganeti-masterd
53 rm -f /var/lock/subsys/ganeti-masterd
54}
55
56# HUP causes daemon to reopen logs only
57reload() {
58 if [ ! -f /var/lock/subsys/ganeti-masterd ]; then
59 msg_not_running "Ganeti Cluster master daemon"
60 RETVAL=7
61 return
62 fi
63
64 msg_reloading "Ganeti Cluster master daemon"
65 killproc ganeti-masterd -HUP
66 RETVAL=$?
67}
68
69condrestart() {
70 if [ ! -f /var/lock/subsys/ganeti-masterd ]; then
71 msg_not_running "Ganeti Cluster master daemon"
72 RETVAL=$1
73 return
74 fi
75
76 stop
77 start
78}
79
80RETVAL=0
81# See how we were called.
82case "$1" in
83 start)
84 start
85 ;;
86 stop)
87 stop
88 ;;
89 restart)
90 stop
91 start
92 ;;
93 try-restart)
94 condrestart 0
95 ;;
96 reload|force-reload|flush-logs)
97 reload
98 ;;
99 status)
100 status --pidfile /var/run/ganeti/ganeti-masterd.pid ganeti-masterd
101 exit $?
102 ;;
103 *)
104 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|flush-logs|status}"
105 exit 3
106esac
107
108exit $RETVAL
This page took 0.098116 seconds and 4 git commands to generate.