diff options
author | Jimmy Olgeni <olgeni@FreeBSD.org> | 2014-02-06 15:00:25 +0000 |
---|---|---|
committer | Jimmy Olgeni <olgeni@FreeBSD.org> | 2014-02-06 15:00:25 +0000 |
commit | 0a105e1045db7a1091890a107c984d65766cc4f9 (patch) | |
tree | 7e4d2df1eae8021e8b8a0ecba70304421e2e2061 /net/rabbitmq | |
parent | 0e5ad33ae8c69e329d4e24a11ca5f6ca19997471 (diff) |
Add a separate "wait" command to the startup script, to be used
with automated deployment systems to ensure that RabbitMQ is actually
available.
The pid file may exist, but it can still be empty when $rabbitmq_ctl
is executed. In this case the script would not wait for anything
and produce some weird output on the console.
PR: ports/185962 (follow up)
Notes
Notes:
svn path=/head/; revision=343104
Diffstat (limited to 'net/rabbitmq')
-rw-r--r-- | net/rabbitmq/Makefile | 1 | ||||
-rw-r--r-- | net/rabbitmq/files/rabbitmq.in | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/net/rabbitmq/Makefile b/net/rabbitmq/Makefile index 95d468be8ece..194f2c3af9a4 100644 --- a/net/rabbitmq/Makefile +++ b/net/rabbitmq/Makefile @@ -3,6 +3,7 @@ PORTNAME= rabbitmq PORTVERSION= 3.2.3 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= http://www.rabbitmq.com/releases/rabbitmq-server/v${PORTVERSION}/ DISTNAME= ${PORTNAME}-server-${PORTVERSION} diff --git a/net/rabbitmq/files/rabbitmq.in b/net/rabbitmq/files/rabbitmq.in index 32eee117f3d7..3169624ae88d 100644 --- a/net/rabbitmq/files/rabbitmq.in +++ b/net/rabbitmq/files/rabbitmq.in @@ -31,7 +31,8 @@ stop_cmd="env HOME=/var/db/rabbitmq su -m ${rabbitmq_user} -c 'sh -c \"${rabbitm stop_postcmd="wait_for_pids $rc_pid" rotate_logs_cmd="env HOME=/var/db/rabbitmq su -m ${rabbitmq_user} -c 'sh -c \"${rabbitmq_ctl} rotate_logs\"'" status_cmd="env HOME=/var/db/rabbitmq su -m ${rabbitmq_user} -c 'sh -c \"${rabbitmq_ctl} status\"'" -extra_commands="rotate_logs status" +extra_commands="rotate_logs status wait" +wait_cmd=rabbitmq_wait rabbitmq_start() { @@ -44,7 +45,10 @@ rabbitmq_start() su -m ${rabbitmq_user} \ -c "sh -c \"${rabbitmq_ctl} status\"" \ | sed -n 's/[^p]*pid,\([0-9]*\)[^0-9]*/\1/p' > ${pidfile} -# Wait until rabbitmq is up and fully functional +} + +rabbitmq_wait() +{ $rabbitmq_ctl wait ${pidfile} } |