Fix: missing logger in the escalation class.
[shinken.git] / bin / init.d / shinken-all
blobc8aa3c5fa2745cbbbc251df2de64e8b2a1d66be1
1 #!/bin/bash
3 # Shinken Starts Shinken
6 # chkconfig: 345 99 01
7 # description: Start Shinken daemons
9 # Source function library.
10 if [ -f /etc/init.d/functions ]; then
11 . /etc/init.d/functions
14 SHINKEN_USER=shinken
15 SHINKEN_GROUP=shinken
17 SHINKEN_BIN=/usr/local/shinken/bin
18 SHINKEN_VAR=/usr/local/shinken/var/
20 start() {
21 echo "Starting Shinken Daemons ..."
22 su - $SHINKEN_USER -c "$SHINKEN_BIN/launch_scheduler.sh"
23 su - $SHINKEN_USER -c "$SHINKEN_BIN/launch_poller.sh"
24 su - $SHINKEN_USER -c "$SHINKEN_BIN/launch_reactionner.sh"
25 su - $SHINKEN_USER -c "$SHINKEN_BIN/launch_broker.sh"
26 su - $SHINKEN_USER -c "$SHINKEN_BIN/launch_arbiter.sh"
27 # chown -R $SHINKEN_GROUP:$NAGIOS_GROUP $SHINKEN_VAR
28 echo_success
29 echo
33 stop() {
34 echo "Stopping Shinken Daemons ..."
35 su - $SHINKEN_USER -c "$SHINKEN_BIN/stop_scheduler.sh"
36 su - $SHINKEN_USER -c "$SHINKEN_BIN/stop_poller.sh"
37 su - $SHINKEN_USER -c "$SHINKEN_BIN/stop_reactionner.sh"
38 su - $SHINKEN_USER -c "$SHINKEN_BIN/stop_broker.sh"
39 su - $SHINKEN_USER -c "$SHINKEN_BIN/stop_arbiter.sh"
40 sleep 3
41 count=$(ps aux | grep python2.6 | grep -v grep | wc -l)
42 if [ $count -gt 0 ]; then
43 killall python2.6
45 echo_success
46 echo
50 case "$1" in
51 restart)
52 stop
53 start
54 exit 0
56 start)
57 start
58 exit 0
60 stop)
61 stop
62 exit 0
65 echo $"Usage: $0 {start|stop|restart}"
66 exit 2
67 esac
69 exit $?