diff --git a/sysutils/zrepl/Makefile b/sysutils/zrepl/Makefile index 38ded8f82ac8..124fc8f2eff4 100644 --- a/sysutils/zrepl/Makefile +++ b/sysutils/zrepl/Makefile @@ -1,64 +1,65 @@ # Created by: Nikolai Lifanov and Ben Woods PORTNAME= zrepl DISTVERSIONPREFIX= v DISTVERSION= 0.4.0 +PORTREVISION= 1 CATEGORIES= sysutils MAINTAINER= lcook@FreeBSD.org COMMENT= ZFS dataset replication tool LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE USES= gmake go:modules USE_RC_SUBR= zrepl GO_MODULE= github.com/${PORTNAME}/${PORTNAME} SUB_FILES= pkg-message OPTIONS_DEFINE= EXAMPLES MANPAGES OPTIONS_DEFAULT= MANPAGES MANPAGES_BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sphinx>=1.8.5,1:textproc/py-sphinx@${PY_FLAVOR} MANPAGES_USES= python:build,3.6+ MANPAGES_PLIST_FILES= man/man1/zrepl.1.gz .include .if ${OPSYS} == "FreeBSD" && ${OSVERSION} >= 1300079 USES+= ncurses .else USES+= ncurses:port CFLAGS+= -I${LOCALBASE}/include/ncurses .endif .if ${OPSYS} == "FreeBSD" SUB_LIST+= DAEMON_LOGGING="-S -l \$${zrepl_facility} -s \$${zrepl_priority} -T \$${name}" .else SUB_LIST+= DAEMON_LOGGING="" .endif post-build-MANPAGES-on: @${MAKE_CMD} -C ${WRKSRC}/docs SPHINXBUILD=sphinx-build-${PYTHON_VER} man post-install: @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} \ ${STAGEDIR}${ETCDIR} \ ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d \ ${STAGEDIR}${PREFIX}/etc/syslog.d \ ${STAGEDIR}/var/run/zrepl ${INSTALL_DATA} ${FILESDIR}/newsyslog.conf ${STAGEDIR}${EXAMPLESDIR}/newsyslog.conf ${INSTALL_DATA} ${FILESDIR}/syslog.conf ${STAGEDIR}${EXAMPLESDIR}/syslog.conf ${INSTALL_DATA} ${FILESDIR}/zrepl.yml ${STAGEDIR}${ETCDIR}/zrepl.yml.sample post-install-EXAMPLES-on: @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/hooks (cd ${WRKSRC}/config/samples && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}) ${INSTALL_DATA} ${WRKSRC}/dist/grafana/grafana-prometheus-zrepl.json ${STAGEDIR}${EXAMPLESDIR} post-install-MANPAGES-on: ${INSTALL_MAN} ${WRKSRC}/docs/_build/man/zrepl.1 ${STAGEDIR}${PREFIX}/man/man1 .include diff --git a/sysutils/zrepl/files/zrepl.in b/sysutils/zrepl/files/zrepl.in index 128cd406f652..57a4d48ce0b6 100644 --- a/sysutils/zrepl/files/zrepl.in +++ b/sysutils/zrepl/files/zrepl.in @@ -1,79 +1,79 @@ #!/bin/sh # PROVIDE: zrepl # REQUIRE: LOGIN # KEYWORD: shutdown # # 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 . /etc/rc.subr name=zrepl rcvar=${name}_enable load_rc_config $name : ${zrepl_enable:="NO"} : ${zrepl_config:="%%PREFIX%%/etc/zrepl/zrepl.yml"} : ${zrepl_user:="root"} : ${zrepl_group:="wheel"} : ${zrepl_flags:=""} : ${zrepl_facility:="local0"} : ${zrepl_priority:="alert"} : ${zrepl_options:="${zrepl_flags} --config ${zrepl_config}"} pidfile="/var/run/zrepl/daemon.pid" command="/usr/sbin/daemon" procname="%%PREFIX%%/bin/zrepl" command_args="-p ${pidfile} %%DAEMON_LOGGING%% ${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"; + install -d -g ${zrepl_group} -o ${zrepl_user} -m 0755 -- "/var/run/zrepl"; + install -d -g ${zrepl_group} -o ${zrepl_user} -m 0755 -- "/var/run/zrepl/stdinserver"; fi if [ ! -e "${pidfile}" ]; then install -g ${zrepl_group} -o ${zrepl_user} -- /dev/null "${pidfile}"; fi zrepl_checkconfig } zrepl_postcmd() { rm -f -- "${pidfile}" } zrepl_checkconfig() { echo "Performing sanity check on zrepl configuration:" eval ${procname} ${zrepl_options} configcheck } run_rc_command "$1"