git: ee0efe6ff6fb - main - net-mgmt/librenms: fix rc script restart race & log rotation

From: Dan Langille <dvl_at_FreeBSD.org>
Date: Mon, 14 Sep 2026 11:35:59 UTC
The branch main has been updated by dvl:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ee0efe6ff6fb1b7eaf278c02a12c07a0144bd535

commit ee0efe6ff6fb1b7eaf278c02a12c07a0144bd535
Author:     Dan Langille <dvl@FreeBSD.org>
AuthorDate: 2026-09-14 11:30:57 +0000
Commit:     Dan Langille <dvl@FreeBSD.org>
CommitDate: 2026-09-14 11:35:20 +0000

    net-mgmt/librenms: fix rc script restart race & log rotation
    
    Please stop librenms service before updating. No harm will occur.
    The value in the PID file changes from the service to the supervisor.
    
    Behavior changes: "service librenms status" now reports the daemon(8)
    supervisor PID instead of the python PID; log rotation now actually
    re-opens the log file.
    
    Upgrade note: an instance started with the previous rc script is
    invisible to the new procname and still holds the pidfile lock. Stop
    the service before upgrading, or SIGTERM the old supervisor (visible in
    ps as "daemon: ..."), which cleanly terminates the child and removes
    the pidfile.
    
    PR:             298398
---
 net-mgmt/librenms/Makefile                    | 1 +
 net-mgmt/librenms/files/librenms.in           | 4 ++--
 net-mgmt/librenms/files/newsyslog.conf.sample | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/net-mgmt/librenms/Makefile b/net-mgmt/librenms/Makefile
index f5210ff86e5a..2ea5ddfad827 100644
--- a/net-mgmt/librenms/Makefile
+++ b/net-mgmt/librenms/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	librenms
 PORTVERSION=	26.8.2
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	net-mgmt
 MASTER_SITES=	LOCAL/dvl:vendor
diff --git a/net-mgmt/librenms/files/librenms.in b/net-mgmt/librenms/files/librenms.in
index 7746f15ce9b8..41eee659694f 100644
--- a/net-mgmt/librenms/files/librenms.in
+++ b/net-mgmt/librenms/files/librenms.in
@@ -34,7 +34,7 @@ load_rc_config $name
 : ${librenms_daemonflags:="-o /var/log/$name/$name-service.log"}
 
 pidfile="$librenms_pid"
-procname="%%PYTHON%%"
+procname=/usr/sbin/daemon
 command="/usr/sbin/daemon"
 
 start_precmd=librenms_precmd
@@ -47,6 +47,6 @@ librenms_precmd()
 	cd %%WWWDIR%%
 }
 
-command_args="$librenms_daemonflags -p $pidfile $procname %%WWWDIR%%/librenms-service.py"
+command_args="$librenms_daemonflags -H -P $pidfile %%PYTHON%% %%WWWDIR%%/librenms/librenms-service.py"
 
 run_rc_command "$1"
diff --git a/net-mgmt/librenms/files/newsyslog.conf.sample b/net-mgmt/librenms/files/newsyslog.conf.sample
index 6ab0c80a68ab..0a6e2547ed32 100644
--- a/net-mgmt/librenms/files/newsyslog.conf.sample
+++ b/net-mgmt/librenms/files/newsyslog.conf.sample
@@ -3,4 +3,4 @@
 # see newsyslog.conf(5) for details
 #
 # logfilename                   [owner:group]    mode count size when  flags [/pid_file] [sig_num]
-/var/log/librenms/*.log	        www:www          644  14    *    $D0   G
+/var/log/librenms/*.log	        www:www          644  14    *    $D0   G     /var/run/librenms/librenms.pid