From nobody Sat Feb 18 08:11:45 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJhGn556Fz3rZw6; Sat, 18 Feb 2023 08:11:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PJhGn327Xz4Gkn; Sat, 18 Feb 2023 08:11:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676707905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PlaSC6pNBfsGfwRD8Wi6RZqNJZ+BLVV7p5X3oPXEUJ4=; b=lJxnSzwibvJT8yXdnSNnK5zlMwgVFSI3ne48cFdhHEpUsuM5JmAkbKSQAnwB/ZTCNrh60s 3DuBEcMmnqY2tUS6hwi0/FMLEt5vGEQ8qHDl36ajy81ZnBgfWQhW2xvNFSGkRT1Ye8x6ty yPDTzKdNNc6cp1n5M7qBVZg1qJxdiCj4C9cx4ZUT/ZAdfHHovXb+9WYts15hb6yySeAa/1 Z3xOh1cjV8QSN1hXuIL0Sm0kd2J5yOnoJP8Z9hKpSMQNcGHWu5fLmoZHoxCRqwMGXO9Oqy UnGbg3M1qsQ+qMGCMbdA9H71IFnosFwQ9vDrywOAJy9LDvqLt1aGWIqOVMPkRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676707905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PlaSC6pNBfsGfwRD8Wi6RZqNJZ+BLVV7p5X3oPXEUJ4=; b=gWwxZGu5l+a50bZUMOoO6xXaRZnYbwF5K1StkMqL4rFFlSrk6sFeeKyrUw8G1sS1nBEPFe bc3qEe8i1ZOTwQlLNQ8jqlvqvmscUOYQuveNNUsWFxTl8GGLpEsqdICIUCy0rZCN8W4YHb ccMCLCaIgsm1tF7EX364SYnaORd90laV+ALObNze8nXu+OOI24HeVgJhx4e+bOFj4Khpks elZSTsrRnIx+hnMUmvpFTeVYD+Ek1ZD0Gej/GwYQKBlEHfu2uKQ5VYG3ZZDbb0EP4+zcFU 0ZOoln+MFOKQtBiv7yOWUvuY6I4AM5ucDwIPyknC/LI7OiToSj/VFDOHIMWgwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676707905; a=rsa-sha256; cv=none; b=nvIatA7lk19aqWWgKruHN66hJ3whGHMG2SIH+xViuSeegCOWoeDgMdtIQDiO7DqG4M9/1D +6VC+LQk00QYCfymKAQU0KbKMBmvyRyI/DXAev+O2t6IxkFABIVK4Nbi5IroZsw4uk7O7q yUXMT64Y6dqz2N1uVb7EL36sE0efqzSUtbevaNusmFthmsqrF7DT1ncqyBp63QghxsKQ4E 1lYd8hmT3GK2XkmaEJOwAZY+A9pxhlhUrhhnNbAOIX9+CRvpU0uC4GVumhvSliWuzAULx2 9RVTy/gz6MuKj/b2pZM4wBJuYWYKLGbB0m1dLD9p1MN5G1qYtMe0diORaNCNMw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PJhGn278YzG8q; Sat, 18 Feb 2023 08:11:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31I8BjQo050885; Sat, 18 Feb 2023 08:11:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31I8BjUl050884; Sat, 18 Feb 2023 08:11:45 GMT (envelope-from git) Date: Sat, 18 Feb 2023 08:11:45 GMT Message-Id: <202302180811.31I8BjUl050884@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Jimmy Olgeni Subject: git: f39b219f5749 - main - net/rabbitmq: rc.d improvements List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olgeni X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f39b219f5749d7b2dc3f46bfda9de37e9b5f1625 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by olgeni: URL: https://cgit.FreeBSD.org/ports/commit/?id=f39b219f5749d7b2dc3f46bfda9de37e9b5f1625 commit f39b219f5749d7b2dc3f46bfda9de37e9b5f1625 Author: Jimmy Olgeni AuthorDate: 2023-02-17 19:40:18 +0000 Commit: Jimmy Olgeni CommitDate: 2023-02-18 08:10:45 +0000 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 --- net/rabbitmq/files/rabbitmq.in | 9 +++++++-- 1 file 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