Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.2:ARM
rabbitmq-server
rabbitmq-server.init
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File rabbitmq-server.init of Package rabbitmq-server
#!/bin/sh # # rabbitmq-server RabbitMQ broker # # chkconfig: - 80 05 # description: Enable AMQP service provided by RabbitMQ # ### BEGIN INIT INFO # Provides: rabbitmq-server # Required-Start: $local_fs $network $remote_fs # Required-Stop: $local_fs $network $remote_fs # Default-Start: 3 5 # Default-Stop: 0 1 2 4 6 # Description: RabbitMQ broker # Short-Description: Enable AMQP service provided by RabbitMQ broker ### END INIT INFO PATH=/sbin:/usr/sbin:/bin:/usr/bin NAME=rabbitmq-server DAEMON=/usr/sbin/${NAME} CONTROL=/usr/sbin/rabbitmqctl DESC=rabbitmq-server USER=rabbitmq ROTATE_SUFFIX= INIT_LOG_DIR=/var/log/rabbitmq PID_FILE=/var/run/rabbitmq/pid DEFAULTS_FILE=/etc/sysconfig/rabbitmq-server LOCK_FILE=/var/run/rabbitmq/lock test -x $DAEMON || exit 0 test -x $CONTROL || exit 0 # Include rabbitmq defaults if available if [ -f "$DEFAULTS_FILE" ] ; then . $DEFAULTS_FILE export RABBITMQ_MNESIA_BASE RABBITMQ_LOG_BASE \ RABBITMQ_NODENAME RABBITMQ_NODE_IP_ADDRESS RABBITMQ_NODE_PORT \ RABBITMQ_CLUSTER_CONFIG_FILE RABBITMQ_CONFIG_FILE fi mkdir -p /var/run/rabbitmq chown rabbitmq. /var/run/rabbitmq RETVAL=0 set -e start_rabbitmq () { status_rabbitmq quiet if [ $RETVAL = 0 ] ; then echo RabbitMQ is currently running else RETVAL=0 set +e setsid sh -c "RABBITMQ_PID_FILE=$PID_FILE $DAEMON > \ ${INIT_LOG_DIR}/startup_log 2> ${INIT_LOG_DIR}/startup_err" & $CONTROL wait $PID_FILE >/dev/null 2>&1 RETVAL=$? set -e case "$RETVAL" in 0) echo SUCCESS if [ -n "$LOCK_FILE" ] ; then touch $LOCK_FILE fi ;; *) rm -f $PID_FILE echo FAILED - check ${INIT_LOG_DIR}/startup_\{log, _err\} RETVAL=1 ;; esac fi } stop_rabbitmq () { status_rabbitmq quiet if [ $RETVAL = 0 ] ; then set +e $CONTROL stop > ${INIT_LOG_DIR}/shutdown_log 2> ${INIT_LOG_DIR}/shutdown_err RETVAL=$? set -e if [ $RETVAL = 0 ] ; then rm -f $PID_FILE if [ -n "$LOCK_FILE" ] ; then rm -f $LOCK_FILE fi else echo FAILED - check ${INIT_LOG_DIR}/shutdown_log, _err fi else echo RabbitMQ is not running RETVAL=0 fi } status_rabbitmq() { set +e if [ "$1" != "quiet" ] ; then $CONTROL status 2>&1 else $CONTROL status > /dev/null 2>&1 fi if [ $? != 0 ] ; then RETVAL=3 fi set -e } rotate_logs_rabbitmq() { set +e $CONTROL rotate_logs ${ROTATE_SUFFIX} if [ $? != 0 ] ; then RETVAL=1 fi set -e } restart_running_rabbitmq () { status_rabbitmq quiet if [ $RETVAL = 0 ] ; then restart_rabbitmq else echo RabbitMQ is not runnning RETVAL=0 fi } restart_rabbitmq() { stop_rabbitmq start_rabbitmq } case "$1" in start) echo -n "Starting $DESC: " start_rabbitmq echo "$NAME." ;; stop) echo -n "Stopping $DESC: " stop_rabbitmq echo "$NAME." ;; status) status_rabbitmq ;; rotate-logs) echo -n "Rotating log files for $DESC: " rotate_logs_rabbitmq ;; force-reload|reload|restart) echo -n "Restarting $DESC: " restart_rabbitmq echo "$NAME." ;; condrestart|try-restart) echo -n "Restarting $DESC: " restart_running_rabbitmq echo "$NAME." ;; *) echo "Usage: $0 {start|stop|status|rotate-logs|restart|condrestart|try-restart|reload|force-reload}" >&2 RETVAL=1 ;; esac exit $RETVAL
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor