From nobody Thu Aug 08 14:36:23 2024 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 4WfqNl3qs1z5Sx5d; Thu, 08 Aug 2024 14:36:23 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WfqNl3MvGz49fQ; Thu, 8 Aug 2024 14:36:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723127783; 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=Hss+K7uvl9xDBRjWs3lJpKykPzsmxypp+lb1j54c6Es=; b=Onh/0wGrVKtyuoyDvjcYXfM4dRAA16l+7l7YpNjs39PB9vvTijv8Xh5gn7YMoo94lOrmN5 xc1X/u9YVxq6uMjTjSgJQHSIX1CgMyvsBGLuKYG+IjSsVomLutm9OJB+wy+XBcuLo7K/PP YjV0rpO88z4iFE0l2LzTEBk20B5u7L04e0FAL5slKKFTFj7XTwE9rPwBP0Gh1mKDjnVUxx tRqkqOhoJeRN57zxGHxtnklgd23ooXtTXZHJjdJu/S8bIGBxj2JB3Exjmi7c8U9JLzLyD1 wfayb6SSfOaEFnbyWai/gM3nQkRJ9dAKdDIkVbGOnR6iDOusVorcDrHJtAWnpQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723127783; a=rsa-sha256; cv=none; b=u+ftEK8teOHiu3AjXD071hAfGbVlwDEe38UGFLEgS1va5RVxcjoDTfK7m3ETep1xbcMijV SZmNlKGWe+9AP/uPNKEq4wezhfgY2g5kqUqpH6XiC0dk6yV2CJ8vFzx0BHqksTmAGS/WwU wMVFw1fhkNRtz5bpHIwl1wfGvEqTZj2TCg79HuxWpHnM1u8rLwzHS7vlfEmu6Nd2Fi9U/V qDMPalyKX9ROc4huuRHOb+2h3viwp4pIR7ewv9dFDrKRkLfGFS5SEAtMXrd+u9LQwm3qt2 0fE5lwFzWWw/kETJs7MwMwssHFq5ClkOLoWQldZVSaOzn/+TowT11gR9P/B21g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723127783; 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=Hss+K7uvl9xDBRjWs3lJpKykPzsmxypp+lb1j54c6Es=; b=Ze+VBuEq+Tj2jNFfhpeu49gG7Tjgy74ub/e5A3tynemjFbWARhWaZp3tr9uvwwH6aMRnQd ImtIvAnsR1pX0z+PMF7jQ3zkbTNiQm7CHdZp+KwH16M+J0YbsoXR3061b+FFmktURzSIJf 8Np2FLR+tFQIg000Xz4N3/vWYFUng9TvE0JJ8M2iqSencmqXmrwHFUUeMshzbAdsAvDwKX w4C/H3DzoTKNKyFCl1DrLr8CkBpuouEvn1kTEb/XWBG2CW8lXuROjoXrf6Cjilxbe9K0pk PgypUGR6eE7WgdLdo0k8pldpq5R54G8ryHoFSuVdprAJsktYoUv6r0o/tdn7rQ== 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 4WfqNl2g7zzcyK; Thu, 8 Aug 2024 14:36:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 478EaNee056700; Thu, 8 Aug 2024 14:36:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 478EaNAS056697; Thu, 8 Aug 2024 14:36:23 GMT (envelope-from git) Date: Thu, 8 Aug 2024 14:36:23 GMT Message-Id: <202408081436.478EaNAS056697@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Fernando =?utf-8?Q?Apestegu=C3=ADa?= Subject: git: 42b2996954c7 - main - dns/knot-resolver: fixing rc scripts krescachegc and kresd 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: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fernape X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 42b2996954c75b2fdcce7e306dc47a3bbaf551c2 Auto-Submitted: auto-generated The branch main has been updated by fernape: URL: https://cgit.FreeBSD.org/ports/commit/?id=42b2996954c75b2fdcce7e306dc47a3bbaf551c2 commit 42b2996954c75b2fdcce7e306dc47a3bbaf551c2 Author: Leo Vandewoestijne AuthorDate: 2024-08-07 15:37:28 +0000 Commit: Fernando ApesteguĂ­a CommitDate: 2024-08-08 14:36:09 +0000 dns/knot-resolver: fixing rc scripts krescachegc and kresd * kresd.i lacked activation of defined status_cmd="${name}_status" * dns/knot-resolver/files/krescachegc.in needed full clean-up: * daemon didn't start due to missing '-c ' * missing 'start', 'stop' and 'status' functionality added PR: 277540 Reported by: trashcan@ellael.org --- dns/knot-resolver/Makefile | 3 +- dns/knot-resolver/distinfo | 6 ++-- dns/knot-resolver/files/krescachegc.in | 52 ++++++++++++++++++++++++++++++---- dns/knot-resolver/files/kresd.in | 52 ++++++++++++++++++---------------- dns/knot-resolver/pkg-plist | 2 +- 5 files changed, 79 insertions(+), 36 deletions(-) diff --git a/dns/knot-resolver/Makefile b/dns/knot-resolver/Makefile index 9bb5b7bf6fb0..9de847ea9946 100644 --- a/dns/knot-resolver/Makefile +++ b/dns/knot-resolver/Makefile @@ -1,6 +1,5 @@ PORTNAME= knot-resolver -DISTVERSION= 5.7.2 -PORTREVISION= 1 +DISTVERSION= 5.7.3 CATEGORIES= dns MASTER_SITES= https://secure.nic.cz/files/knot-resolver/ \ https://dns.company/downloads/knot-resolver/ diff --git a/dns/knot-resolver/distinfo b/dns/knot-resolver/distinfo index b06f3c43b9c4..837708ed2a7d 100644 --- a/dns/knot-resolver/distinfo +++ b/dns/knot-resolver/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1713104201 -SHA256 (knot-resolver-5.7.2.tar.xz) = 5f6a227390fcd4c2d0a8028a652b55a9d863ec7be01298fe038df1d273fb9a0f -SIZE (knot-resolver-5.7.2.tar.xz) = 1928336 +TIMESTAMP = 1722850725 +SHA256 (knot-resolver-5.7.3.tar.xz) = efc6e45ffc5efd98921ea5cd3fece166a1a5ce9eaa12d41b46268964353dbedb +SIZE (knot-resolver-5.7.3.tar.xz) = 1930732 diff --git a/dns/knot-resolver/files/krescachegc.in b/dns/knot-resolver/files/krescachegc.in index 40334bea0bdc..8b04fc0686e4 100644 --- a/dns/knot-resolver/files/krescachegc.in +++ b/dns/knot-resolver/files/krescachegc.in @@ -18,16 +18,58 @@ name=krescachegc rcvar=krescachegc_enable load_rc_config ${name} +load_rc_config_var kresd rundir +load_rc_config_var kresd user -# set defaults -krescachegc_enable=${krescachegc_enable:-"NO"} +: ${krescachegc_enable:="NO"} : ${krescachegc_svcj_options:="net_basic"} -krescachegc_millis=${krescachegc_millis:-"1000"} +: ${krescachegc_millis:="1000"} +: ${kresd_rundir:="/var/run/kresd"} +: ${kresd_user:="%%USERS%%"} -pidfile="%%RUNDIR%%/${name}.pid" procname="%%PREFIX%%/sbin/kres-cache-gc" +start_cmd="${name}_start" +stop_cmd="${name}_stop" +status_cmd="${name}_status" + command=/usr/sbin/daemon -command_args="-c -f -S -r -P ${pidfile} -T ${name} -u %%USERS%% -- ${procname} -d ${krescachegc_millis}" +command_args="-c -f -r -S -u ${kresd_user} -T ${name} -- ${procname} -c ${kresd_rundir} -d ${krescachegc_millis}" + +krescachegc_start() { + /bin/pgrep -f ${procname} > /dev/null && status="$?" || status="$?" + if [ "${status}" -eq 0 ]; then + echo "${name} already seems to be running." + else + echo "starting ${name}..." && \ + ${command} ${command_args} + echo -e "\e[1A\e[K${name} started." + fi + } + +krescachegc_status() { + /bin/pgrep -f ${procname} > /dev/null && status="$?" || status="$?" + if [ "${status}" -eq 0 ]; then + echo "${name} is running:" + echo + /bin/ps -p $(/bin/pgrep -f ${procname}) + else + echo "${name} is not running" + fi + return ${status} + } + +krescachegc_stop() { + /bin/pgrep -f ${procname} > /dev/null && status="$?" || status="$?" + if [ "${status}" -eq 0 ]; then + echo "stopping ${name}..." && \ + /bin/pkill -TERM -f ${procname} + echo -e "\e[1A\e[K${name} stopped." + + else + echo "${name} is not running" + fi + return ${status} + } run_rc_command "$1" diff --git a/dns/knot-resolver/files/kresd.in b/dns/knot-resolver/files/kresd.in index 0ddd5d332466..c322d5e85470 100644 --- a/dns/knot-resolver/files/kresd.in +++ b/dns/knot-resolver/files/kresd.in @@ -20,57 +20,59 @@ rcvar=kresd_enable load_rc_config ${name} -# set defaults -kresd_enable=${kresd_enable:-"NO"} +: ${kresd_enable:="NO"} : ${kresd_svcj_options:="net_basic"} -kresd_config=${kresd_config:-"%%ETCDIR%%/${name}.conf"} -kresd_user="%%USERS%%" -kresd_group="%%GROUPS%%" -kresd_rundir="/var/run/${name}" +: ${kresd_config:="%%ETCDIR%%/${name}.conf"} +: ${kresd_user:="%%USERS%%"} +: ${kresd_group:="%%GROUPS%%"} +: ${kresd_rundir:="%%RUNDIR%%"} -pidfile="${kresd_rundir}/${name}.pid" procname="%%PREFIX%%/sbin/${name}" required_files="${kresd_config}" start_cmd="${name}_start" +status_cmd="${name}_status" stop_cmd="${name}_stop" command="/usr/sbin/daemon" -command_args="-c -f -S -r -P ${pidfile} -T ${name} -- ${procname} -c ${kresd_config} -n -q ${kresd_rundir}" +command_args="-c -f -r -S -T ${name} -- ${procname} -c ${kresd_config} -n -q ${kresd_rundir}" kresd_start() { if [ ! -d /var/run/${name} ]; then install -d -o ${kresd_user} -g ${kresd_group} -m 700 ${kresd_rundir} fi - if [ ! -f "${pidfile}" ]; then + /bin/pgrep -f ${procname} > /dev/null && status="$?" || status="$?" + if [ "${status}" -eq 0 ]; then + echo "${name} already seems to be running." + else echo "starting ${name}..." && \ ${command} ${command_args} echo -e "\e[1A\e[K${name} started." + fi + } + +kresd_status() { + /bin/pgrep -f ${procname} > /dev/null && status="$?" || status="$?" + if [ "${status}" -eq 0 ]; then + echo "${name} is running:" + echo + /bin/ps -p $(/bin/pgrep -f ${procname}) else - echo "${name} already seems to be running." + echo "${name} is not running" fi + return ${status} } kresd_stop() { - if [ -f "${pidfile}" ]; then + /bin/pgrep -f ${procname} > /dev/null && status="$?" || status="$?" + if [ "${status}" -eq 0 ]; then echo "stopping ${name}..." && \ - for pid in `ps waux | grep ${procname} | grep daemon | awk '{print $2}'`; do \ - kill -TERM $pid - done + /bin/pkill -TERM -f ${procname} echo -e "\e[1A\e[K${name} stopped." else - echo "${name} seems to be not running." + echo "${name} is not running" fi + return ${status} } -kresd_status() { - if [ -e "${pidfile}" ]; then - echo "${name} is running on pid $(cat $pidfile)." - return 1 - else - echo "${name} is not running." - return 0 - fi -} - run_rc_command "$1" diff --git a/dns/knot-resolver/pkg-plist b/dns/knot-resolver/pkg-plist index 769c84a35f19..7ee88fee52b1 100644 --- a/dns/knot-resolver/pkg-plist +++ b/dns/knot-resolver/pkg-plist @@ -96,4 +96,4 @@ sbin/kres-cache-gc sbin/kresc sbin/kresd @dir(%%USERS%%,%%GROUPS%%,0755) %%ETCDIR%% -@dir(%%USERS%%,%%GROUPS%%,0660) %%RUNDIR%% +@dir(%%USERS%%,%%GROUPS%%,0700) %%RUNDIR%%