3 # mcollective Application Server for STOMP based agents
7 # description: mcollective lets you build powerful Stomp compatible middleware clients in ruby without having to worry too
8 # much about all the setup and management of a Stomp connection, it also provides stats, logging and so forth
12 # Provides: mcollective
13 # Required-Start: $remote_fs
14 # Required-Stop: $remote_fs
15 # Short-Description: Start daemon at boot time
16 # Description: Enable service provided by daemon.
19 mcollectived="/usr/sbin/mcollectived"
20 pidfile="/var/run/mcollectived.pid"
21 if [ -d /var/lock/subsys ]; then
22 # RedHat/CentOS/etc who use subsys
23 lockfile="/var/lock/subsys/mcollective"
26 lockfile="/var/lock/mcollective"
29 # Check that binary exists
30 if ! [ -f $mcollectived ]; then
31 echo "mcollectived binary not found"
35 # Source function library.
36 . /etc/init.d/functions
38 if [ -f /etc/sysconfig/mcollective ]; then
39 . /etc/sysconfig/mcollective
42 # Determine if we can use the -p option to daemon, killproc, and status.
44 if status | grep -q -- '-p' 2>/dev/null; then
45 daemonopts="--pidfile $pidfile"
50 echo -n "Starting mcollective: "
51 # Only try to start if not already started
52 if ! rh_status_q; then
53 daemon ${daemonopts} ${mcollectived} --pid=${pidfile} --config="/etc/mcollective/server.cfg"
55 # This will be 0 if mcollective is already running
58 [ $RETVAL -eq 0 ] && touch ${lockfile}
63 echo -n "Shutting down mcollective: "
64 # If running, try to stop it
66 killproc ${pidopts} -d 10 ${mcollectived}
68 # Non-zero status either means lockfile and pidfile need cleanup (1 and 2)
69 # or the process is already stopped (3), so we can just call true to
70 # trigger the cleanup that happens below.
75 [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
85 echo -n "Reloading mcollective agents: "
86 killproc ${pidopts} ${mcollectived} -USR1
93 echo -n "Cycling mcollective logging level: "
94 killproc ${pidopts} ${mcollectived} -USR2
101 status ${pidopts} ${mcollectived}
107 rh_status >/dev/null 2>&1
110 # See how we were called.
122 rh_status_q || exit 0
135 echo "Usage: mcollectived {start|stop|restart|condrestart|reload-agents|reload-loglevel|status}"