Skip to content

Commit d734485

Browse files
author
Emile Joubert
committed
Allow stopping stopped; and starting started broker
Consistency and description
1 parent 2b9bc34 commit d734485

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

packaging/debs/Debian/rabbitmq-server.init

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin
2020
NAME=rabbitmq-server
2121
DAEMON=/usr/sbin/${NAME}
2222
CONTROL=/usr/sbin/rabbitmqctl
23-
DESC=rabbitmq-server
23+
DESC="message broker"
2424
USER=rabbitmq
2525
ROTATE_SUFFIX=
2626
INIT_LOG_DIR=/var/log/rabbitmq
@@ -117,8 +117,7 @@ restart_running_rabbitmq () {
117117
if [ $RETVAL = 0 ] ; then
118118
restart_rabbitmq
119119
else
120-
log_warning_msg "$DESC not running"
121-
RETVAL=0
120+
log_warning_msg "${DESC} not running"
122121
fi
123122
}
124123

@@ -140,7 +139,8 @@ start_stop_end() {
140139
0)
141140
log_end_msg 0;;
142141
3)
143-
log_end_msg 1;;
142+
log_warning_msg "${DESC} already ${1}"
143+
log_end_msg 0;;
144144
*)
145145
log_warning_msg "FAILED - check ${INIT_LOG_DIR}/startup_\{log, _err\}"
146146
log_end_msg 1;;
@@ -149,30 +149,30 @@ start_stop_end() {
149149

150150
case "$1" in
151151
start)
152-
log_daemon_msg "Starting ${DESC}" ${NAME}
152+
log_daemon_msg "Starting ${DESC}" $NAME
153153
start_rabbitmq
154-
start_stop_end
154+
start_stop_end "started"
155155
;;
156156
stop)
157-
log_daemon_msg "Stopping ${DESC}" ${NAME}
157+
log_daemon_msg "Stopping ${DESC}" $NAME
158158
stop_rabbitmq
159-
start_stop_end
159+
start_stop_end "stopped"
160160
;;
161161
status)
162162
status_rabbitmq
163163
;;
164164
rotate-logs)
165-
log_action_begin_msg "Rotating log files for $DESC: "
165+
log_action_begin_msg "Rotating log files for ${DESC} ${NAME}"
166166
rotate_logs_rabbitmq
167-
log_action_end_msg $?
167+
log_action_end_msg $RETVAL
168168
;;
169169
force-reload|reload|restart)
170-
log_daemon_msg "Restarting $DESC" "$NAME"
170+
log_daemon_msg "Restarting ${DESC}" $NAME
171171
restart_rabbitmq
172172
restart_end
173173
;;
174174
try-restart)
175-
log_daemon_msg "Restarting $DESC" "$NAME"
175+
log_daemon_msg "Restarting ${DESC}" $NAME
176176
restart_running_rabbitmq
177177
restart_end
178178
;;

0 commit comments

Comments
 (0)