Skip to content

Commit ce57d3e

Browse files
committed
immediately return from RMQ starting
This improves UX, with the slight risk of having it fail immediately without noticing right away. CMK-21190 Change-Id: Iba891076fb7a2ad2493cbd9ef35d57889e731fd5
1 parent 6f7bd2f commit ce57d3e

File tree

1 file changed

+3
-20
lines changed
  • omd/packages/rabbitmq/skel/etc/init.d

1 file changed

+3
-20
lines changed

omd/packages/rabbitmq/skel/etc/init.d/rabbitmq

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,32 +43,15 @@ await_process_stop() {
4343
return 1
4444
}
4545

46-
rabbitmq_accepting_connections() {
47-
"${RABBITMQ_DIAGNOSTICS}" check_port_listener --node "${RABBITMQ_NODENAME}" "${RABBITMQ_PORT}"
48-
# no idea why we can't use this anymore; it will fail for the management plugin
49-
# "${RABBITMQ_DIAGNOSTICS}" check_port_connectivity --node "${RABBITMQ_NODENAME}"
50-
}
51-
5246
await_process_start() {
53-
# Only write output in the end, otherwise we clobber the logfile.
5447
max=$(("${1}" * 10))
5548
# If the PIDFILE gets filled, rabbitmq started
5649
for N in $(seq "${max}"); do
57-
[ -s "${PIDFILE}" ] && rabbitmq_accepting_connections &>/dev/null && break
58-
[ -e "${PIDFILE}" ] || {
59-
date +"%F %T.%N RabbitMQ failed to start (pidfile vanished)"
60-
return 1
61-
}
50+
[ $((N % 10)) -eq 0 ] && printf "."
51+
[ -s "${PIDFILE}" ] && return 0
52+
[ -e "${PIDFILE}" ] || return 1
6253
sleep 0.1
6354
done
64-
65-
# once again, mostly to get the output of the diagnostics call
66-
[ -s "${PIDFILE}" ] && rabbitmq_accepting_connections && {
67-
date +"%F %T.%N RabbitMQ considered ready"
68-
return 0
69-
}
70-
71-
date +"%F %T.%N RabbitMQ failed to start (giving up after timeout)"
7255
return 1
7356
}
7457

0 commit comments

Comments
 (0)