View | Details | Raw Unified | Return to bug 281591 | Differences between
and this patch

Collapse All | Expand All

(-)b/sysutils/zrepl-dsh2dsh/Makefile (-10 / +10 lines)
Lines 1-25 Link Here
1
PORTNAME=	zrepl
1
PORTNAME=		zrepl
2
DISTVERSIONPREFIX=	v
2
DISTVERSIONPREFIX=	v
3
DISTVERSION=	0.7.8
3
DISTVERSION=	0.8.3
4
CATEGORIES=	sysutils
4
CATEGORIES=		sysutils
5
PKGNAMESUFFIX=	-dsh2dsh
5
PKGNAMESUFFIX=	-dsh2dsh
6
6
7
MAINTAINER=	dsh@bamus.cz
7
MAINTAINER=		dsh@bamus.cz
8
COMMENT=	ZFS dataset replication tool (fork with more features)
8
COMMENT=		ZFS dataset replication tool (fork with more features)
9
WWW=		https://github.com/dsh2dsh/${PORTNAME}
9
WWW=			https://github.com/dsh2dsh/${PORTNAME}
10
10
11
LICENSE=	MIT
11
LICENSE=		MIT
12
LICENSE_FILE=	${WRKSRC}/LICENSE
12
LICENSE_FILE=	${WRKSRC}/LICENSE
13
13
14
USES=		go:1.22,modules ncurses
14
USES=			go:1.23,modules ncurses
15
USE_RC_SUBR=	${PORTNAME}
15
USE_RC_SUBR=	${PORTNAME}
16
16
17
GO_MODULE=	github.com/dsh2dsh/${PORTNAME}
17
GO_MODULE=		github.com/dsh2dsh/${PORTNAME}
18
GO_BUILDFLAGS=	-ldflags "${STRIP} -w -X github.com/dsh2dsh/${PORTNAME}/version.${PORTNAME}Version=${DISTVERSIONFULL}"
18
GO_BUILDFLAGS=	-ldflags "${STRIP} -w -X github.com/dsh2dsh/${PORTNAME}/version.${PORTNAME}Version=${DISTVERSIONFULL}"
19
19
20
CONFLICTS_INSTALL=	${PORTNAME}
20
CONFLICTS_INSTALL=	${PORTNAME}
21
21
22
SUB_FILES=	pkg-message 500.${PORTNAME}
22
SUB_FILES=		pkg-message 500.${PORTNAME}
23
23
24
OPTIONS_DEFINE=	EXAMPLES
24
OPTIONS_DEFINE=	EXAMPLES
25
25
(-)b/sysutils/zrepl-dsh2dsh/distinfo (-5 / +5 lines)
Lines 1-5 Link Here
1
TIMESTAMP = 1718809873
1
TIMESTAMP = 1726766984
2
SHA256 (go/sysutils_zrepl-dsh2dsh/zrepl-v0.7.8/v0.7.8.mod) = 6de73508b106ec921d08bc908dd74e461a0f3b37040791d3945ce48c11a2acbd
2
SHA256 (go/sysutils_zrepl-dsh2dsh/zrepl-v0.8.3/v0.8.3.mod) = 6d039a394e4025517e66e4f016d60b5299d1541dca23913e1a8fa96bbedece12
3
SIZE (go/sysutils_zrepl-dsh2dsh/zrepl-v0.7.8/v0.7.8.mod) = 2984
3
SIZE (go/sysutils_zrepl-dsh2dsh/zrepl-v0.8.3/v0.8.3.mod) = 3638
4
SHA256 (go/sysutils_zrepl-dsh2dsh/zrepl-v0.7.8/v0.7.8.zip) = 742801772c8511d8d7f03284520437128a70f8536b9722c9e9990335b6f14d17
4
SHA256 (go/sysutils_zrepl-dsh2dsh/zrepl-v0.8.3/v0.8.3.zip) = ba1ec6e71bb449d6e01b477387cbb003c55cb66f7820f141ce4135f862a9776c
5
SIZE (go/sysutils_zrepl-dsh2dsh/zrepl-v0.7.8/v0.7.8.zip) = 589396
5
SIZE (go/sysutils_zrepl-dsh2dsh/zrepl-v0.8.3/v0.8.3.zip) = 602193
(-)b/sysutils/zrepl-dsh2dsh/files/zrepl.in (-46 / +70 lines)
Lines 4-35 Link Here
4
# REQUIRE: LOGIN
4
# REQUIRE: LOGIN
5
# KEYWORD: shutdown
5
# KEYWORD: shutdown
6
#
6
#
7
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
7
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf to enable this
8
# to enable this service:
8
# service:
9
#
9
#
10
# zrepl_enable (bool):	Set to YES to enable the zrepl service.
10
# zrepl_enable (bool):  Set to YES to enable the zrepl service.
11
#			Default: NO
11
#                       Default: NO
12
# zrepl_config (str):	File containing zrepl configuration details.
12
# zrepl_config (str):   File containing zrepl configuration details.
13
#			Default: %%PREFIX%%/etc/zrepl/zrepl.yml
13
#                       Default: %%PREFIX%%/etc/zrepl/zrepl.yml
14
# zrepl_user (str):	The user account used to run the zrepl daemon.
14
# zrepl_user (str):     The user account used to run the zrepl daemon.
15
#			Do not specifically set this to an empty string as this
15
#                       Do not specifically set this to an empty string as this
16
#			will cause the daemon to run as root.
16
#                       will cause the daemon to run as root.
17
#			Default: root
17
#                       Default: root
18
# zrepl_group (str):	The group account used to run the zrepl daemon.
18
# zrepl_group (str):    The group account used to run the zrepl daemon.
19
#			Do not specifically set this to an empty string as this
19
#                       Do not specifically set this to an empty string as this
20
#			will cause the daemon to run with group wheel.
20
#                       will cause the daemon to run with group wheel.
21
#			Default: wheel
21
#                       Default: wheel
22
# zrepl_flags (str):	Extra flags passed to zrepl
22
# zrepl_flags (str):    Extra flags passed to zrepl
23
#			Default: ""
23
#                       Default: ""
24
# zrepl_facility (str):	Syslog facility to use
24
# zrepl_facility (str): Syslog facility to use
25
#			Default: local0
25
#                       Default: local0
26
# zrepl_priority (str):	Syslog priority to use
26
# zrepl_priority (str): Syslog priority to use
27
#			Default: alert
27
#                       Default: alert
28
#
29
# zrepl_gracefully (bool): Set to YES to always stop the zrepl service
30
#                          gracefully.
31
#                          Default: NO
28
32
29
. /etc/rc.subr
33
. /etc/rc.subr
30
name=zrepl
34
31
rcvar=${name}_enable
35
name="zrepl"
32
load_rc_config $name
36
rcvar="${name}_enable"
37
load_rc_config "$name"
33
38
34
: ${zrepl_enable:="NO"}
39
: ${zrepl_enable:="NO"}
35
: ${zrepl_config:="%%PREFIX%%/etc/zrepl/zrepl.yml"}
40
: ${zrepl_config:="%%PREFIX%%/etc/zrepl/zrepl.yml"}
Lines 38-80 load_rc_config $name Link Here
38
: ${zrepl_flags:=""}
43
: ${zrepl_flags:=""}
39
: ${zrepl_facility:="local0"}
44
: ${zrepl_facility:="local0"}
40
: ${zrepl_priority:="alert"}
45
: ${zrepl_priority:="alert"}
41
: ${zrepl_options:="${zrepl_flags} --config ${zrepl_config}"}
46
: ${zrepl_options:="$zrepl_flags --config $zrepl_config"}
47
: ${zrepl_gracefully:="NO"}
48
49
: ${zrepl_control_group:="$zrepl_group"}
50
: ${zrepl_control_mode:="0700"}
42
51
43
pidfile="/var/run/zrepl.pid"
52
pidfile="/var/run/zrepl.pid"
44
command="/usr/sbin/daemon"
53
command="/usr/sbin/daemon"
45
procname="%%PREFIX%%/bin/zrepl"
54
procname="%%PREFIX%%/bin/zrepl"
46
command_args="-p ${pidfile} -S -l ${zrepl_facility} -s ${zrepl_priority} -T ${name} \
55
command_args="-p $pidfile -S -l $zrepl_facility -s $zrepl_priority -T $name \
47
		${procname} ${zrepl_options} daemon"
56
  $procname $zrepl_options daemon"
48
57
49
start_precmd="zrepl_precmd"
58
start_precmd="zrepl_precmd"
50
stop_postcmd="zrepl_postcmd"
51
restart_precmd="zrepl_checkconfig"
59
restart_precmd="zrepl_checkconfig"
52
configtest_cmd="zrepl_checkconfig"
60
configtest_cmd="zrepl_checkconfig"
53
extra_commands="configtest"
61
graceful_cmd="zrepl_graceful"
54
62
gracefulstop_cmd="zrepl_gracefulstop"
55
zrepl_precmd()
63
extra_commands="configtest graceful gracefulstop"
56
{
57
	if [ ! -d "/var/run/zrepl/stdinserver" ]; then
58
		install -d -g ${zrepl_group} -o ${zrepl_user} -m 0700 -- "/var/run/zrepl";
59
		install -d -g ${zrepl_group} -o ${zrepl_user} -m 0700 -- "/var/run/zrepl/stdinserver";
60
	fi
61
64
62
	if [ ! -e "${pidfile}" ]; then
65
zrepl_checkconfig() {
63
		install -g ${zrepl_group} -o ${zrepl_user} -- /dev/null "${pidfile}";
66
    echo "Performing sanity check on zrepl configuration:"
64
	fi
67
    eval "$procname" $zrepl_options configcheck
68
}
65
69
66
	zrepl_checkconfig
70
zrepl_precmd() {
71
    if [ ! -d "/var/run/zrepl/stdinserver" ]; then
72
        install -d -g "$zrepl_control_group" -o "$zrepl_user" \
73
                -m "$zrepl_control_mode"   "/var/run/zrepl"
74
        install -d -g "$zrepl_control_group" -o "$zrepl_user" \
75
                -m  "$zrepl_control_mode"  "/var/run/zrepl/stdinserver"
76
    fi
77
    zrepl_checkconfig
67
}
78
}
68
79
69
zrepl_postcmd()
80
zrepl_graceful() {
70
{
81
    local _rc_prefix _return
71
	rm -f -- "${pidfile}"
82
		( run_rc_command gracefulstop $rc_extra_args )
83
		( run_rc_command start $rc_extra_args )
84
		_return=$?
85
		[ $_return -ne 0 ] && [ -z "$rc_force" ] && return 1
86
    return $_return
72
}
87
}
73
88
74
zrepl_checkconfig()
89
zrepl_gracefulstop() {
75
{
90
    if [ -z "$rc_pid" ]; then
76
	echo "Performing sanity check on zrepl configuration:"
91
        echo 1>&2 "${name} not running? (check $pidfile)."
77
	eval ${procname} ${zrepl_options} configcheck
92
        return 1
93
    fi
94
95
    echo "Gracefully stopping ${name}."
96
    eval "$procname" signal shutdown
97
    wait_for_pids "$rc_pid"
78
}
98
}
79
99
100
if checkyesno zrepl_gracefully; then
101
    stop_cmd="zrepl_gracefulstop"
102
fi
103
80
run_rc_command "$1"
104
run_rc_command "$1"
(-)b/sysutils/zrepl-dsh2dsh/files/zrepl.yml (-12 lines)
Lines 30-37 jobs: Link Here
30
      type: "periodic"
30
      type: "periodic"
31
      interval: "1h"
31
      interval: "1h"
32
      prefix: "zrepl_hourly_"
32
      prefix: "zrepl_hourly_"
33
      timestamp_format: "20060102_150405_MST"
34
      timestamp_local: true
35
    pruning: &keep-all
33
    pruning: &keep-all
36
34
37
  - name: "daily-snap"
35
  - name: "daily-snap"
Lines 41-48 jobs: Link Here
41
      type: "periodic"
39
      type: "periodic"
42
      interval: "1d"
40
      interval: "1d"
43
      prefix: "zrepl_daily_"
41
      prefix: "zrepl_daily_"
44
      timestamp_format: "20060102_150405_MST"
45
      timestamp_local: true
46
    pruning: *keep-all
42
    pruning: *keep-all
47
43
48
  - name: "monthly-snap"
44
  - name: "monthly-snap"
Lines 52-59 jobs: Link Here
52
      type: "periodic"
48
      type: "periodic"
53
      interval: "30d"
49
      interval: "30d"
54
      prefix: "zrepl_monthly_"
50
      prefix: "zrepl_monthly_"
55
      timestamp_format: "20060102_150405_MST"
56
      timestamp_local: true
57
    pruning: *keep-all
51
    pruning: *keep-all
58
52
59
  - name: "zdisk"
53
  - name: "zdisk"
Lines 95-104 jobs: Link Here
95
      listener_name: "zdisk"
89
      listener_name: "zdisk"
96
      client_identity: "localhost"
90
      client_identity: "localhost"
97
    filesystems: *filesystems
91
    filesystems: *filesystems
98
    # send:
99
    #   execpipe:
100
    #     # zfs send | mbuffer
101
    #     - [ "/usr/local/bin/mbuffer", "-q", "-s", "128k", "-m", "1G" ]
102
    replication: &replication
92
    replication: &replication
103
      # Send all intermediary snapshots as a stream package, instead of sending
93
      # Send all intermediary snapshots as a stream package, instead of sending
104
      # them one by one.
94
      # them one by one.
Lines 112-119 jobs: Link Here
112
      type: "periodic"
102
      type: "periodic"
113
      cron: "*/15 * * * *"
103
      cron: "*/15 * * * *"
114
      prefix: "zrepl_frequently_"
104
      prefix: "zrepl_frequently_"
115
      timestamp_format: "20060102_150405_MST"
116
      timestamp_local: true
117
    pruning:
105
    pruning:
118
      keep_sender:
106
      keep_sender:
119
        - type: "not_replicated"
107
        - type: "not_replicated"
(-)b/sysutils/zrepl-dsh2dsh/pkg-descr (-1 / +14 lines)
Lines 4-17 feature detection, bookmarks, and other new features. Link Here
4
This is a fork with more features like
4
This is a fork with more features like
5
5
6
  * support of shell patterns for datasets definitions
6
  * support of shell patterns for datasets definitions
7
7
  * new log formatters
8
  * new log formatters
9
8
  * ability to log into a file
10
  * ability to log into a file
11
9
  * ability to configure command piplines between `zfs send` and `zfs recv`
12
  * ability to configure command piplines between `zfs send` and `zfs recv`
13
10
  * Icinga/Nagios checks
14
  * Icinga/Nagios checks
15
11
  * fast skip "keep all" pruning
16
  * fast skip "keep all" pruning
12
  * snapshots can be named using local time in timestamps
17
18
  * snapshots named using local time in timestamps
19
13
  * configurable RPC timeout
20
  * configurable RPC timeout
21
14
  * configurable path to zfs binary
22
  * configurable path to zfs binary
23
15
  * faster replication
24
  * faster replication
16
25
26
  * graceful shutdown
27
28
  * redesigned `zrepl status` TUI
29
17
and so on.
30
and so on.
(-)b/sysutils/zrepl-dsh2dsh/pkg-plist (-2 lines)
Lines 20-23 etc/periodic/weekly/500.zrepl Link Here
20
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/source.yml
20
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/source.yml
21
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/source_ssh.yml
21
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/source_ssh.yml
22
@dir etc/newsyslog.conf.d
22
@dir etc/newsyslog.conf.d
23
@dir(root,wheel,0750) /var/run/zrepl
24
- 

Return to bug 281591