From nobody Wed Sep 25 06:30:08 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 4XD6KY0Kb9z5Wj1Q; Wed, 25 Sep 2024 06:30:09 +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 4XD6KX4NBHz486c; Wed, 25 Sep 2024 06:30:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727245808; 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=lkDI1ggAiN3RNqO0guNNTouz8pJyw9zDkd6rVaMgWmw=; b=wCIba8CuNclpRCw/osdWUUCXti7dK31OTKE+yulIimmaPUoLkhcG2j97K+I2surUYcmAKA h3UiR1yf0B5+QdP+9tDW7HrB305FNyl8FyohV0+HZengD0FYQQ4mKCxDxAeWNipVXj0KsG C2l5woubbgQ55q1kbltuWQghrlzQwExSvy6GT4Ihp3v0OR/qPa/EPNBF2GXj3NaOQ5Gl8v 3xrGDaiZ4G5SwYLU4qfnD/DvGKaGvB/6K6qaz8YelCBViLolco8DmLLQUKTM2tucbhv8S1 T6iR+XiEvDzOFy44bD1/BYqku0VmIH7NkZMujluQIotA1jJz67gY2NezqoT1rg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727245808; a=rsa-sha256; cv=none; b=kUqgKXt1j1CZBngPkOecZQSDQsTDMCyl9zDPMBMSOu4o2PHY+7zyySbg9IYIjJIWrkdF07 52o6cAyEw6n72dCGgsodYbqFOzRG0LZvsfuAJjazdHv+aCGDzqsWAn0BzCjkZuWmDH441v jS/OnK6aI5NSFgBsufH97jdxrNjn0zF9AtG8pshVD9d/xtLXEtTp3Z+Q7Cd342M1rngUJ6 5U+Cg6gcHUDssK2V6fL8JphXRbCz6Y6PSA48Tdagyt7iEYmgUW25wUIFmpBtP/5bpTNtyX 2Xv80SqxYy8pazyKN8qrueLC0njzYsINRfEzUdDBXWx5T0UqoYt2yK8RjemPtQ== 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=1727245808; 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=lkDI1ggAiN3RNqO0guNNTouz8pJyw9zDkd6rVaMgWmw=; b=kXNVkv6p+sLRi1Jgs3QrIbCpjU3SWNTm+y+1/9NcG2N4BsJ5LG76DmKN3XZA02Wp45emRx mPwPq6mYPVg+HQLkc8Nxw8Pe3sG6csvGdy9zDsRmKVUrXPQjwdCNYqyY3prY6f9NXn0zR8 h2+/dlekUVuJTpJz1KRH2fCGx/+FO/LWu38zW/wnNhYORA97XO1eHkiXhdmMSoGaOwLTSK TdYM5jOhTCw5Y3LytgWDNHpnekNiJ7GgtlsIE8up2q8Sw8HtRsJVWJPEUz1RTAp1+GYuJ7 mQLKZIW0ut+Q1BpkQeFwcwPbt4cChZaw7vT9aB3QtZqXVn/GDqE/62D8kiEEGA== 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 4XD6KX3KHfz124P; Wed, 25 Sep 2024 06:30:08 +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 48P6U8rZ047270; Wed, 25 Sep 2024 06:30:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48P6U8uM047266; Wed, 25 Sep 2024 06:30:08 GMT (envelope-from git) Date: Wed, 25 Sep 2024 06:30:08 GMT Message-Id: <202409250630.48P6U8uM047266@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Robert Clausecker Subject: git: 664fa9b2fe89 - main - sysutils/zrepl-dsh2dsh: update to 0.8.3 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: fuz X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 664fa9b2fe89d886243f58a81f6109063bf208ea Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/ports/commit/?id=664fa9b2fe89d886243f58a81f6109063bf208ea commit 664fa9b2fe89d886243f58a81f6109063bf208ea Author: Denis Shaposhnikov AuthorDate: 2024-09-21 13:38:04 +0000 Commit: Robert Clausecker CommitDate: 2024-09-25 06:28:04 +0000 sysutils/zrepl-dsh2dsh: update to 0.8.3 Changelog: https://github.com/dsh2dsh/zrepl/releases/tag/v0.8.3 PR: 281591 Event: EuroBSDcon 2024 --- sysutils/zrepl-dsh2dsh/Makefile | 11 ++-- sysutils/zrepl-dsh2dsh/distinfo | 10 +-- sysutils/zrepl-dsh2dsh/files/zrepl.in | 116 ++++++++++++++++++++------------- sysutils/zrepl-dsh2dsh/files/zrepl.yml | 12 ---- sysutils/zrepl-dsh2dsh/pkg-descr | 8 ++- sysutils/zrepl-dsh2dsh/pkg-plist | 1 - 6 files changed, 85 insertions(+), 73 deletions(-) diff --git a/sysutils/zrepl-dsh2dsh/Makefile b/sysutils/zrepl-dsh2dsh/Makefile index c17df694bca6..c238886cd900 100644 --- a/sysutils/zrepl-dsh2dsh/Makefile +++ b/sysutils/zrepl-dsh2dsh/Makefile @@ -1,6 +1,6 @@ PORTNAME= zrepl DISTVERSIONPREFIX= v -DISTVERSION= 0.7.8 +DISTVERSION= 0.8.3 CATEGORIES= sysutils PKGNAMESUFFIX= -dsh2dsh @@ -11,7 +11,7 @@ WWW= https://github.com/dsh2dsh/${PORTNAME} LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE -USES= go:1.22,modules ncurses +USES= go:1.23,modules ncurses USE_RC_SUBR= ${PORTNAME} GO_MODULE= github.com/dsh2dsh/${PORTNAME} @@ -24,10 +24,9 @@ SUB_FILES= pkg-message 500.${PORTNAME} OPTIONS_DEFINE= EXAMPLES post-install: - @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} \ + ${MKDIR} ${STAGEDIR}${EXAMPLESDIR} \ ${STAGEDIR}${ETCDIR} \ - ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d \ - ${STAGEDIR}/var/run/${PORTNAME} + ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d ${INSTALL_DATA} ${FILESDIR}/newsyslog.conf \ ${STAGEDIR}${EXAMPLESDIR}/newsyslog.conf ${INSTALL_DATA} ${FILESDIR}/${PORTNAME}.yml \ @@ -37,7 +36,7 @@ post-install: ${STAGEDIR}${PREFIX}/etc/periodic/weekly/500.${PORTNAME} post-install-EXAMPLES-on: - @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/hooks + ${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/hooks (cd ${WRKSRC}/config/samples && \ ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}) ${INSTALL_DATA} \ diff --git a/sysutils/zrepl-dsh2dsh/distinfo b/sysutils/zrepl-dsh2dsh/distinfo index 77e2b6aa4cb4..ed630c91e26f 100644 --- a/sysutils/zrepl-dsh2dsh/distinfo +++ b/sysutils/zrepl-dsh2dsh/distinfo @@ -1,5 +1,5 @@ -TIMESTAMP = 1718809873 -SHA256 (go/sysutils_zrepl-dsh2dsh/zrepl-v0.7.8/v0.7.8.mod) = 6de73508b106ec921d08bc908dd74e461a0f3b37040791d3945ce48c11a2acbd -SIZE (go/sysutils_zrepl-dsh2dsh/zrepl-v0.7.8/v0.7.8.mod) = 2984 -SHA256 (go/sysutils_zrepl-dsh2dsh/zrepl-v0.7.8/v0.7.8.zip) = 742801772c8511d8d7f03284520437128a70f8536b9722c9e9990335b6f14d17 -SIZE (go/sysutils_zrepl-dsh2dsh/zrepl-v0.7.8/v0.7.8.zip) = 589396 +TIMESTAMP = 1726766984 +SHA256 (go/sysutils_zrepl-dsh2dsh/zrepl-v0.8.3/v0.8.3.mod) = 6d039a394e4025517e66e4f016d60b5299d1541dca23913e1a8fa96bbedece12 +SIZE (go/sysutils_zrepl-dsh2dsh/zrepl-v0.8.3/v0.8.3.mod) = 3638 +SHA256 (go/sysutils_zrepl-dsh2dsh/zrepl-v0.8.3/v0.8.3.zip) = ba1ec6e71bb449d6e01b477387cbb003c55cb66f7820f141ce4135f862a9776c +SIZE (go/sysutils_zrepl-dsh2dsh/zrepl-v0.8.3/v0.8.3.zip) = 602193 diff --git a/sysutils/zrepl-dsh2dsh/files/zrepl.in b/sysutils/zrepl-dsh2dsh/files/zrepl.in index 6a2510f80572..2db852dd2a49 100644 --- a/sysutils/zrepl-dsh2dsh/files/zrepl.in +++ b/sysutils/zrepl-dsh2dsh/files/zrepl.in @@ -4,32 +4,37 @@ # REQUIRE: LOGIN # KEYWORD: shutdown # -# Add the following lines to /etc/rc.conf.local or /etc/rc.conf -# to enable this service: +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf to enable this +# service: # -# zrepl_enable (bool): Set to YES to enable the zrepl service. -# Default: NO -# zrepl_config (str): File containing zrepl configuration details. -# Default: %%PREFIX%%/etc/zrepl/zrepl.yml -# zrepl_user (str): The user account used to run the zrepl daemon. -# Do not specifically set this to an empty string as this -# will cause the daemon to run as root. -# Default: root -# zrepl_group (str): The group account used to run the zrepl daemon. -# Do not specifically set this to an empty string as this -# will cause the daemon to run with group wheel. -# Default: wheel -# zrepl_flags (str): Extra flags passed to zrepl -# Default: "" -# zrepl_facility (str): Syslog facility to use -# Default: local0 -# zrepl_priority (str): Syslog priority to use -# Default: alert +# zrepl_enable (bool): Set to YES to enable the zrepl service. +# Default: NO +# zrepl_config (str): File containing zrepl configuration details. +# Default: %%PREFIX%%/etc/zrepl/zrepl.yml +# zrepl_user (str): The user account used to run the zrepl daemon. +# Do not specifically set this to an empty string as this +# will cause the daemon to run as root. +# Default: root +# zrepl_group (str): The group account used to run the zrepl daemon. +# Do not specifically set this to an empty string as this +# will cause the daemon to run with group wheel. +# Default: wheel +# zrepl_flags (str): Extra flags passed to zrepl +# Default: "" +# zrepl_facility (str): Syslog facility to use +# Default: local0 +# zrepl_priority (str): Syslog priority to use +# Default: alert +# +# zrepl_gracefully (bool): Set to YES to always stop the zrepl service +# gracefully. +# Default: NO . /etc/rc.subr -name=zrepl -rcvar=${name}_enable -load_rc_config $name + +name="zrepl" +rcvar="${name}_enable" +load_rc_config "$name" : ${zrepl_enable:="NO"} : ${zrepl_config:="%%PREFIX%%/etc/zrepl/zrepl.yml"} @@ -38,43 +43,62 @@ load_rc_config $name : ${zrepl_flags:=""} : ${zrepl_facility:="local0"} : ${zrepl_priority:="alert"} -: ${zrepl_options:="${zrepl_flags} --config ${zrepl_config}"} +: ${zrepl_options:="$zrepl_flags --config $zrepl_config"} +: ${zrepl_gracefully:="NO"} + +: ${zrepl_control_group:="$zrepl_group"} +: ${zrepl_control_mode:="0700"} pidfile="/var/run/zrepl.pid" command="/usr/sbin/daemon" procname="%%PREFIX%%/bin/zrepl" -command_args="-p ${pidfile} -S -l ${zrepl_facility} -s ${zrepl_priority} -T ${name} \ - ${procname} ${zrepl_options} daemon" +command_args="-p $pidfile -S -l $zrepl_facility -s $zrepl_priority -T $name \ + $procname $zrepl_options daemon" start_precmd="zrepl_precmd" -stop_postcmd="zrepl_postcmd" restart_precmd="zrepl_checkconfig" configtest_cmd="zrepl_checkconfig" -extra_commands="configtest" - -zrepl_precmd() -{ - if [ ! -d "/var/run/zrepl/stdinserver" ]; then - install -d -g ${zrepl_group} -o ${zrepl_user} -m 0700 -- "/var/run/zrepl"; - install -d -g ${zrepl_group} -o ${zrepl_user} -m 0700 -- "/var/run/zrepl/stdinserver"; - fi +graceful_cmd="zrepl_graceful" +gracefulstop_cmd="zrepl_gracefulstop" +extra_commands="configtest graceful gracefulstop" - if [ ! -e "${pidfile}" ]; then - install -g ${zrepl_group} -o ${zrepl_user} -- /dev/null "${pidfile}"; - fi +zrepl_checkconfig() { + echo "Performing sanity check on zrepl configuration:" + eval "$procname" $zrepl_options configcheck +} - zrepl_checkconfig +zrepl_precmd() { + if [ ! -d "/var/run/zrepl/stdinserver" ]; then + install -d -g "$zrepl_control_group" -o "$zrepl_user" \ + -m "$zrepl_control_mode" "/var/run/zrepl" + install -d -g "$zrepl_control_group" -o "$zrepl_user" \ + -m "$zrepl_control_mode" "/var/run/zrepl/stdinserver" + fi + zrepl_checkconfig } -zrepl_postcmd() -{ - rm -f -- "${pidfile}" +zrepl_graceful() { + local _rc_prefix _return + ( run_rc_command gracefulstop $rc_extra_args ) + ( run_rc_command start $rc_extra_args ) + _return=$? + [ $_return -ne 0 ] && [ -z "$rc_force" ] && return 1 + return $_return } -zrepl_checkconfig() -{ - echo "Performing sanity check on zrepl configuration:" - eval ${procname} ${zrepl_options} configcheck +zrepl_gracefulstop() { + if [ -z "$rc_pid" ]; then + echo 1>&2 "${name} not running? (check $pidfile)." + return 1 + fi + + echo "Gracefully stopping ${name}." + eval "$procname" signal shutdown + wait_for_pids "$rc_pid" } +if checkyesno zrepl_gracefully; then + stop_cmd="zrepl_gracefulstop" +fi + run_rc_command "$1" diff --git a/sysutils/zrepl-dsh2dsh/files/zrepl.yml b/sysutils/zrepl-dsh2dsh/files/zrepl.yml index 3f9278c345bc..048f5d58b1a5 100644 --- a/sysutils/zrepl-dsh2dsh/files/zrepl.yml +++ b/sysutils/zrepl-dsh2dsh/files/zrepl.yml @@ -30,8 +30,6 @@ jobs: type: "periodic" interval: "1h" prefix: "zrepl_hourly_" - timestamp_format: "20060102_150405_MST" - timestamp_local: true pruning: &keep-all - name: "daily-snap" @@ -41,8 +39,6 @@ jobs: type: "periodic" interval: "1d" prefix: "zrepl_daily_" - timestamp_format: "20060102_150405_MST" - timestamp_local: true pruning: *keep-all - name: "monthly-snap" @@ -52,8 +48,6 @@ jobs: type: "periodic" interval: "30d" prefix: "zrepl_monthly_" - timestamp_format: "20060102_150405_MST" - timestamp_local: true pruning: *keep-all - name: "zdisk" @@ -95,10 +89,6 @@ jobs: listener_name: "zdisk" client_identity: "localhost" filesystems: *filesystems - # send: - # execpipe: - # # zfs send | mbuffer - # - [ "/usr/local/bin/mbuffer", "-q", "-s", "128k", "-m", "1G" ] replication: &replication # Send all intermediary snapshots as a stream package, instead of sending # them one by one. @@ -112,8 +102,6 @@ jobs: type: "periodic" cron: "*/15 * * * *" prefix: "zrepl_frequently_" - timestamp_format: "20060102_150405_MST" - timestamp_local: true pruning: keep_sender: - type: "not_replicated" diff --git a/sysutils/zrepl-dsh2dsh/pkg-descr b/sysutils/zrepl-dsh2dsh/pkg-descr index b75b34c591f5..2a89cb5c62d7 100644 --- a/sysutils/zrepl-dsh2dsh/pkg-descr +++ b/sysutils/zrepl-dsh2dsh/pkg-descr @@ -1,5 +1,5 @@ -Cross-platform ZFS replication tool written in Go that supports -feature detection, bookmarks, and other new features. +Cross-platform ZFS replication tool written in Go that supports feature +detection, bookmarks, and other new features. This is a fork with more features like @@ -9,9 +9,11 @@ This is a fork with more features like * ability to configure command piplines between `zfs send` and `zfs recv` * Icinga/Nagios checks * fast skip "keep all" pruning - * snapshots can be named using local time in timestamps + * snapshots named using local time in timestamps * configurable RPC timeout * configurable path to zfs binary * faster replication + * graceful shutdown + * redesigned `zrepl status` TUI and so on. diff --git a/sysutils/zrepl-dsh2dsh/pkg-plist b/sysutils/zrepl-dsh2dsh/pkg-plist index fc11dec8cfb3..7f2c52e6e5f6 100644 --- a/sysutils/zrepl-dsh2dsh/pkg-plist +++ b/sysutils/zrepl-dsh2dsh/pkg-plist @@ -20,4 +20,3 @@ etc/periodic/weekly/500.zrepl %%PORTEXAMPLES%%%%EXAMPLESDIR%%/source.yml %%PORTEXAMPLES%%%%EXAMPLESDIR%%/source_ssh.yml @dir etc/newsyslog.conf.d -@dir(root,wheel,0750) /var/run/zrepl