From nobody Sat Jul 20 09:03:24 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 4WR0vJ3cdYz5RHvR; Sat, 20 Jul 2024 09:03:24 +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 4WR0vJ35ysz4jN7; Sat, 20 Jul 2024 09:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721466204; 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=6jA+GOolwAdLmnLFXI1mHDfjf861D1fOs4VI/bg4Fe0=; b=Gqaa1Qrg7OkTGvz1iaKvTk91+n8fxxXJyr747CyKCyRdwD8mACLOXuGeRADZdsAqVpI9Xt m1LhAaLAL+LMZcrSAwVhx80oAOEJi7D3NiG0M29wOA0nSHAWKSNuywM6GvoqITS6PTC8j+ YYQ6n0GSQjky9z5Fbu7o0u285XOP0x7s+3jTRT7Pps5/WQEBldm30CgpNzmx7Hdke/fqo+ U61+DCfE3xamrI3BU6xgs6sIKC68ygXfYoyb1MjhGJBTGUc1o8JNaBJ0huAW2uZ6ij/N+/ LpZ3fx/NdFiq76qYdIg2f6s5C18zpYyzmsIj7ylHrhFiV7EMqrKjbZniGbYWng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721466204; a=rsa-sha256; cv=none; b=GpzN+uXD8nYXYmiz98QRvwH4kTbNK2w/QYr/t+KDGJy0tbzfWLCc391PKIHxBeIgj8xsk0 6ZLSBXo8NIY4GlSKVvBHkIRpMTDUZy0co4NgQb9AAvtVNKGOUxn9fBan8SomhpX44XGEAs 9yDM+i63jjfNKSIpF7LF1sQhzvBoEUBjWhJ2EIsB1GFlDesDVNZfOFiPFBG/9rbsUOqAvZ aXGnOkdrXFMUbA/GGheffRFDp89K9Fqi/UOzB+lQrSux/WikOyZY8vjNGWub90lCMBwPDV RGxqj7IEh7JEYG4UNiUzo/YLQSGUp4qBPUJZ75rzdyL8JeDObJ/E2Sx2SW7b2w== 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=1721466204; 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=6jA+GOolwAdLmnLFXI1mHDfjf861D1fOs4VI/bg4Fe0=; b=f+HBgYrZGeKCWXTs+33b/3ozpynM613SvIyGkiL9Avj5jwSOCOCHFfwxg/KvGG5unRb9X7 zvFO+Xee0ymQnM0FWZog3WpA2XlH+hb7RNajadY10IGD1hnrQQ7CPs2XfocLXegjMprsgr qNor1B1ZupW+KCicpFt9tAVwlX0dNfWZJR3RZ93ScIuQdqze6/FxYdKjvvQ4Un3+QGSdQ5 Rj9IVa91075EB83qyALT9fEAiB6kSpfuI4WHuqAz21Aa1auid9qtQBlWBJZYnB53v9qGPu tXy5LpkBPdv7Pt+jiYqrU/muaKUGKdGmIlE1gUtJMzzwdH1hvxHBJH75twtNgg== 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 4WR0vJ2cgyz19P1; Sat, 20 Jul 2024 09:03:24 +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 46K93OaB052289; Sat, 20 Jul 2024 09:03:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46K93OAP052286; Sat, 20 Jul 2024 09:03:24 GMT (envelope-from git) Date: Sat, 20 Jul 2024 09:03:24 GMT Message-Id: <202407200903.46K93OAP052286@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Matthias Andree Subject: git: 93449dfa01a5 - main - dns/dnsmasq*: add a checkconfig option to rcfile 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: mandree X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 93449dfa01a515bf3b2c7d6e6c08d7e56e0aabf6 Auto-Submitted: auto-generated The branch main has been updated by mandree: URL: https://cgit.FreeBSD.org/ports/commit/?id=93449dfa01a515bf3b2c7d6e6c08d7e56e0aabf6 commit 93449dfa01a515bf3b2c7d6e6c08d7e56e0aabf6 Author: Dmitry Selivanov AuthorDate: 2024-07-20 08:59:57 +0000 Commit: Matthias Andree CommitDate: 2024-07-20 09:03:06 +0000 dns/dnsmasq*: add a checkconfig option to rcfile and automatically invoke it before restart or stop. Under the hood, this runs dnsmasq --test. Bump PORTREVISION of dnsmasq only, the -devel port is not built regularly. [commit message by Matthias Andree ] --- dns/dnsmasq-devel/files/dnsmasq.in | 16 ++++++++++++++-- dns/dnsmasq/Makefile | 2 +- dns/dnsmasq/files/dnsmasq.in | 16 ++++++++++++++-- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/dns/dnsmasq-devel/files/dnsmasq.in b/dns/dnsmasq-devel/files/dnsmasq.in index bd62247f6694..1311df694b69 100644 --- a/dns/dnsmasq-devel/files/dnsmasq.in +++ b/dns/dnsmasq-devel/files/dnsmasq.in @@ -59,13 +59,15 @@ load_rc_config "${name}" command_args="-x $pidfile -C $dnsmasq_conf" required_files="${dnsmasq_conf}" -extra_commands="reload logstats" +extra_commands="reload logstats checkconfig" reload_precmd="reload_pre" reload_postcmd="reload_post" +restart_precmd="checkconfig" start_postcmd="timestampconf" -stop_precmd="rmtimestamp" +stop_precmd="stop_pre" logstats_cmd="logstats" +checkconfig_cmd="checkconfig" reload_pre() { if [ "$dnsmasq_conf" -nt "${timestamp}" ] ; then @@ -94,4 +96,14 @@ rmtimestamp() { rm -f "${timestamp}" } +stop_pre() { + checkconfig || return + rmtimestamp +} + +checkconfig() { + echo "Performing sanity check on ${name} configuration." + ${command} ${command_args} --test +} + run_rc_command "$1" diff --git a/dns/dnsmasq/Makefile b/dns/dnsmasq/Makefile index 89589552e859..522c420f55a5 100644 --- a/dns/dnsmasq/Makefile +++ b/dns/dnsmasq/Makefile @@ -1,7 +1,7 @@ PORTNAME= dnsmasq DISTVERSION= 2.90 # Leave the PORTREVISION in even if 0 to avoid accidental PORTEPOCH bumps: -PORTREVISION= 1 +PORTREVISION= 2 PORTEPOCH= 1 CATEGORIES= dns MASTER_SITES= https://www.thekelleys.org.uk/dnsmasq/ \ diff --git a/dns/dnsmasq/files/dnsmasq.in b/dns/dnsmasq/files/dnsmasq.in index bd62247f6694..1311df694b69 100644 --- a/dns/dnsmasq/files/dnsmasq.in +++ b/dns/dnsmasq/files/dnsmasq.in @@ -59,13 +59,15 @@ load_rc_config "${name}" command_args="-x $pidfile -C $dnsmasq_conf" required_files="${dnsmasq_conf}" -extra_commands="reload logstats" +extra_commands="reload logstats checkconfig" reload_precmd="reload_pre" reload_postcmd="reload_post" +restart_precmd="checkconfig" start_postcmd="timestampconf" -stop_precmd="rmtimestamp" +stop_precmd="stop_pre" logstats_cmd="logstats" +checkconfig_cmd="checkconfig" reload_pre() { if [ "$dnsmasq_conf" -nt "${timestamp}" ] ; then @@ -94,4 +96,14 @@ rmtimestamp() { rm -f "${timestamp}" } +stop_pre() { + checkconfig || return + rmtimestamp +} + +checkconfig() { + echo "Performing sanity check on ${name} configuration." + ${command} ${command_args} --test +} + run_rc_command "$1"