3 # mcollective Application Server for STOMP based agents
6 # description: mcollective lets you build powerful Stomp compatible middleware clients in ruby without having to worry too
7 # much about all the setup and management of a Stomp connection, it also provides stats, logging and so forth
11 # Provides: mcollective
12 # Required-Start: $remote_fs
13 # Required-Stop: $remote_fs
14 # Default-Start: 2 3 4 5
16 # Short-Description: Start daemon at boot time
17 # Description: Enable service provided by mcollective.
23 [ $uid -gt 0 ] && { echo "You need to be root to run file" ; exit 4 ; }
27 pidfile="/var/run/mcollective.pid"
30 mcollectived=/usr/sbin/mcollectived
31 daemonopts="--config=/etc/mcollective/server.cfg"
34 # Source function library.
35 . /lib/lsb/init-functions
37 # Check that binary exists
38 if ! [ -f $mcollectived ]
40 echo "mcollectived binary not found"
44 # See how we were called.
47 echo "Starting daemon: " $name
49 if [ -f $pidfile ]; then
50 if [ -f $(cat /proc/$(cat $pidfile)/exe > /dev/null) ] ; then
51 echo MCollective appears to be running
54 /sbin/start-stop-daemon --start -b --quiet --oknodo -m --pidfile $pidfile --exec $mcollectived -- $daemonopts
55 [ $? = 0 ] && { exit 0 ; } || { exit 1 ; }
58 /sbin/start-stop-daemon --start -b --quiet --oknodo -m --pidfile $pidfile --exec $mcollectived -- $daemonopts
60 log_success_msg "mcollective started"
63 echo "Stopping daemon: " $name
64 /sbin/start-stop-daemon --stop -q --pidfile $pidfile
65 if [ -f $pidfile ]; then
68 [ $? = 0 ] && { exit 0 ; } || { exit 1 ; }
69 log_success_msg "mcollective stopped"
72 echo "Restarting daemon: " $name
76 [ $? = 0 ] && { echo "mcollective restarted" ; exit 0 ; }
79 status_of_proc -p ${pidfile} ${mcollectived} ${name} && exit 0 || exit $?
82 echo "Usage: mcollectived {start|stop|restart|condrestart|status}"