summaryrefslogtreecommitdiff
path: root/net/rabbitmq
diff options
context:
space:
mode:
authorJimmy Olgeni <olgeni@FreeBSD.org>2023-02-17 20:40:18 +0100
committerJimmy Olgeni <olgeni@FreeBSD.org>2023-02-18 09:10:45 +0100
commitf39b219f5749d7b2dc3f46bfda9de37e9b5f1625 (patch)
tree38ee4e6abb162d620b584a4a9f35e8ca98beef51 /net/rabbitmq
parentnet/rabbitmq: update to version 3.11.9 (diff)
net/rabbitmq: rc.d improvements
This commit creates a separate directory at /var/run/rabbitmq to host the RabbitMQ pid file. Previously, the pid file was not being created properly (it was empty) and this was causing issues with the process of waiting for pids (as the pid file existed, but had no value and was considered "garbage"). With this change the pid file is created with the correct value, enabling the process of waiting for pids to complete successfully; now the startup script returns exit code 0. Additionally, this commit exports the variables RABBITMQ_HOME, RABBITMQ_LOG_BASE, and RABBITMQ_PID_FILE so that the RabbitMQ process can properly locate the pid file. These changes resolve PR 264062. PR: 264062 Reported by: FiLiS <freebsdbugs@filis.org>
Diffstat (limited to 'net/rabbitmq')
-rw-r--r--net/rabbitmq/files/rabbitmq.in9
1 files changed, 7 insertions, 2 deletions
diff --git a/net/rabbitmq/files/rabbitmq.in b/net/rabbitmq/files/rabbitmq.in
index 0e0024484e8e..b2581043633d 100644
--- a/net/rabbitmq/files/rabbitmq.in
+++ b/net/rabbitmq/files/rabbitmq.in
@@ -23,7 +23,7 @@ load_rc_config $name
rabbitmq_server="%%PREFIX%%/sbin/rabbitmq-server"
rabbitmq_ctl="%%PREFIX%%/sbin/rabbitmqctl"
rabbitmq_env_conf="%%PREFIX%%/etc/rabbitmq/rabbitmq-env.conf"
-pidfile="/var/run/${name}.pid"
+pidfile="/var/run/rabbitmq/${name}.pid"
start_cmd="${name}_start"
stop_cmd="${name}_stop"
@@ -64,7 +64,11 @@ rabbitmq_start()
chmod 600 ${RABBITMQ_HOME}/.erlang.cookie
fi
- install -o ${rabbitmq_user} /dev/null ${pidfile}
+ install -d -o ${rabbitmq_user} -g ${rabbitmq_user} /var/run/${name}
+
+ export RABBITMQ_HOME RABBITMQ_LOG_BASE RABBITMQ_PID_FILE
+
+ rm -f ${pidfile}
debug "Running: rabbitmq-server -detached"
su -m ${rabbitmq_user} -c "${rabbitmq_server} -detached" >/dev/null 2>&1
@@ -75,6 +79,7 @@ rabbitmq_start()
rabbitmq_stop()
{
echo "Stopping ${name}."
+
if [ -f ${pidfile} ]; then
debug "Running: ${rabbitmq_ctl} stop ${pidfile}"
su -m ${rabbitmq_user} -c "${rabbitmq_ctl} stop ${pidfile}" >/dev/null 2>&1