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/mcollectived.pid"
30 mcollectived=/usr/sbin/mcollectived
31 daemonopts="--pid=${pidfile} --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 # create pid file if it does not exist
45 [ ! -f ${pidfile} ] && { touch ${pidfile} ; }
47 # See how we were called.
50 echo "Starting daemon: " $name
52 start-stop-daemon -S -p ${pidfile} --oknodo -q -a ${mcollectived} -- ${daemonopts}
53 [ $? = 0 ] && { exit 0 ; } || { exit 1 ; }
54 log_success_msg "mcollective started"
58 echo "Stopping daemon: " $name
59 start-stop-daemon -K -R 5 -s "TERM" --oknodo -q -p ${pidfile}
60 [ $? = 0 ] && { exit 0 ; } || { exit 1 ; }
61 log_success_msg "mcollective stopped"
64 echo "Restarting daemon: " $name
68 [ $? = 0 ] && { echo "mcollective restarted" ; exit 0 ; }
79 echo "not implemented"
82 status_of_proc -p ${pidfile} ${mcollectived} ${name} && exit 0 || exit $?
85 echo "Usage: mcollectived {start|stop|restart|condrestart|status}"