git: d65cd3c8c58f - 2023Q1 - sysutils/cbsd: Update to 13.1.24

From: Kirill Ponomarev <krion_at_FreeBSD.org>
Date: Sun, 05 Mar 2023 07:02:22 UTC
The branch 2023Q1 has been updated by krion:

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

commit d65cd3c8c58f5fe3f344e0d2b611cc675f9353ec
Author:     Kirill Ponomarev <krion@FreeBSD.org>
AuthorDate: 2023-03-05 07:01:25 +0000
Commit:     Kirill Ponomarev <krion@FreeBSD.org>
CommitDate: 2023-03-05 07:02:19 +0000

    sysutils/cbsd: Update to 13.1.24
    
    Changes: https://github.com/cbsd/cbsd/releases/tag/v13.1.24
    (cherry picked from commit 21a1241f97d5e4401b5c72b1edffce69afd0f141)
---
 sysutils/cbsd/Makefile                    |  2 +-
 sysutils/cbsd/distinfo                    |  6 +++---
 sysutils/cbsd/files/cbsd-statsd-hoster.in | 13 ++++++++++---
 sysutils/cbsd/files/cbsdd.in              |  9 +++++++--
 4 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/sysutils/cbsd/Makefile b/sysutils/cbsd/Makefile
index 466beb26b480..6503954f6044 100644
--- a/sysutils/cbsd/Makefile
+++ b/sysutils/cbsd/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	cbsd
-DISTVERSION=	13.1.23
+DISTVERSION=	13.1.24
 CATEGORIES=	sysutils
 
 MAINTAINER=	olevole@olevole.ru
diff --git a/sysutils/cbsd/distinfo b/sysutils/cbsd/distinfo
index e0f4bbb92e1d..0f0f8f9e6edd 100644
--- a/sysutils/cbsd/distinfo
+++ b/sysutils/cbsd/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1676995850
-SHA256 (cbsd-cbsd-13.1.23_GH0.tar.gz) = c5c098c315fa310036ebf32c2ba05acdbcc808820a3da9bfa474064b2dca432f
-SIZE (cbsd-cbsd-13.1.23_GH0.tar.gz) = 6497345
+TIMESTAMP = 1677920358
+SHA256 (cbsd-cbsd-13.1.24_GH0.tar.gz) = 7517e95f0dae287f6d62021863c3a5a6228fc7cd2297393c7e7e7cdb770bf841
+SIZE (cbsd-cbsd-13.1.24_GH0.tar.gz) = 6499073
diff --git a/sysutils/cbsd/files/cbsd-statsd-hoster.in b/sysutils/cbsd/files/cbsd-statsd-hoster.in
index ae09eaae83ff..730898d63964 100644
--- a/sysutils/cbsd/files/cbsd-statsd-hoster.in
+++ b/sysutils/cbsd/files/cbsd-statsd-hoster.in
@@ -24,7 +24,11 @@ restart_cmd=${name}_restart
 extra_commands="restart"
 
 command="%%PREFIX%%/cbsd/tools/racct-hoster-statsd"
-pidfile="/var/run/$name.pid"
+pidfile="/var/run/${name}.pid"
+daemon_pidfile="/var/run/${name}-daemon.pid"
+daemon_logdir="/var/log/${name}"
+daemon_logfile="${daemon_logdir}/cbsd-statsd-hoster.log"
+
 command_args="&"
 
 pidfile=/var/run/racct-hoster-statsd.pid
@@ -40,7 +44,7 @@ if [ ! -f ${subr} ]; then
 fi
 
 . ${globalconf}
-. ${subr}
+. ${subrdir}/nc.subr
 
 cbsd_statsd_hoster_start()
 {
@@ -84,7 +88,10 @@ cbsd_statsd_hoster_start()
 			;;
 	esac
 
-	exec env workdir=${cbsd_workdir} %%PREFIX%%/cbsd/tools/racct-hoster-statsd ${args}
+	[ ! -d ${daemon_logdir} ] && mkdir -p ${daemon_logdir}
+	touch ${daemon_logfile}
+
+	/usr/sbin/daemon -f -R5 -p ${pidfile} -P ${daemon_pidfile} -o ${daemon_logfile} /usr/bin/env workdir=${cbsd_workdir} ${command} ${args}
 }
 
 cbsd_statsd_hoster_restart()
diff --git a/sysutils/cbsd/files/cbsdd.in b/sysutils/cbsd/files/cbsdd.in
index 7508dd6632bc..cbde5558a692 100644
--- a/sysutils/cbsd/files/cbsdd.in
+++ b/sysutils/cbsd/files/cbsdd.in
@@ -17,6 +17,11 @@ load_rc_config $name
 
 export workdir="${cbsd_workdir}"
 export NO_CBSD_HISTORY=yes
+# disable interactive question
+export NOINTER=1
+# always answer 'no'
+export ALWAYS_NO=1
+
 globalconf=${cbsd_globalconf:-"%%PREFIX%%/cbsd/cbsd.conf"}
 
 if [ ! -f ${globalconf} ]; then
@@ -41,7 +46,7 @@ fi
 
 . ${globalconf}
 . ${mdtools}
-. ${subr}
+. ${subrdir}/nc.subr
 
 . ${localcbsdconf}
 
@@ -92,7 +97,7 @@ cbsdd_stop()
 cbsdd_restart()
 {
 	if [ -f "${pidfile}" ]; then
-		pkill -9 -f ${pidfile} > /dev/null 2>&1
+		pkill -9 -F ${pidfile} > /dev/null 2>&1
 		/bin/rm -f ${pidfile}
 	fi
 	run_rc_command "start"