add sysutils/zrepl port
Needs ReviewPublic

Authored by lifanov on Sep 22 2017, 1:45 PM.



zrepl is a tool for replicating ZFS filesystems

Diff Detail

rP FreeBSD ports repository
No Linters Available
No Unit Test Coverage
Build Status
Buildable 11684
Build 12030: arc lint + arc unit
lifanov created this revision.Sep 22 2017, 1:45 PM
mat added inline comments.Sep 22 2017, 2:03 PM

This appears too early.

lifanov updated this revision to Diff 33329.Sep 22 2017, 2:58 PM

address mat's feedback: move PLIST_FILES after USES/USE block

This looks good, and I believe is ready for commit. I have included a couple of minor comments here, which are not show-stoppers.


These first 3 blocks are probably indented one tab too many


This is indented one tab too many


This is indented one tab too many


Having discussed this port with Christian at EuroBSDcon, I think we should include a small warning after this description to explain that there has not yet been the first 0.1 release yet, and as such this probably should not be used in "production" environments just yet.

woodsb02 updated this revision to Diff 33589.Sep 30 2017, 11:20 AM

Add rc script and warning message. Fix indentation.

Hi Nikolai,
I hope you don't mind, but I updated this diff myself because I had added an rc script which makes it much easier to use.
I have completed build and run testing. It is working nicely.
Feel free to revert any changes if you don't like them.
Ben requested changes to this revision.Sep 30 2017, 12:31 PM

I restructured logging during EuroBSDCon - zrepl now supports writing to syslog directly, as well as several log formats and other log sinks.

The revision I would like to see in ports is 7c86628f3b6d77c1b3833e1f75a979690aed5f30.

Compared to what we have here right now, changes required are:

  • newsyslog.conf.d entry
  • default config with syslog output enabled -> see examples / extend zrepl docs
  • daemon(8) should then interpret any stderr & stdout output as LOG_ALERT, since the only output there will be errors encountered while writing to the logging sinks
  • update dependencies if required

I'm on a train with flaky internet connection, so I cannot update the Gopkg files right, now, will do sow in a few hours, which will be another commit.

This revision now requires changes to proceed.Sep 30 2017, 12:31 PM

OK, the Gopkg.{toml,lock} from 7c86628f3b6d77c1b3833e1f75a979690aed5f30 is up-to date, so the deps listed there are the ones required to build.

Hi Christian,

To me it sounds like you could tag your first (beta) 0.1 release as commit 7c86628f3b6d77c1b3833e1f75a979690aed5f30. Can I encourage this? ;)

Also, do we still need the big scary warning I introduced in pkg-message?


I mention tagging a release, because I think it will encourage users to begin testing it in non-production environments, and because it’s important for users to be using a consistent version during this pre-release testing. It’s not a 1.0 release, so it doesn’t matter that it’s not something you consider feature complete. Far too often do I see software on GitHub that doesn’t tag releases.

So I actually released a 0.0.1, signed with my pubkey.

I guess the warning can go away...


Can we write zrepl in small letters here?

So I actually released a 0.0.1, signed with my pubkey.

I guess the warning can go away...

Great news! Thanks for that :)

For some reason I can't download the release using the 0.01 release number. When I put that into the port and run "make makesum" I get the following output:

/usr/ports/sysutils/zrepl$ make makesum
=> zrepl-zrepl-0.01_GH0.tar.gz doesn't seem to exist in /usr/local/poudriere/ports/default/distfiles/.
=> Attempting to fetch
fetch: Not Found

Are you sure you tagged the release in the normal way? Instructions are here:

*facepalm* thanks... working now. :)

woodsb02 updated this revision to Diff 33599.Oct 1 2017, 9:29 AM

As per comments from Christian Schwarz (zrepl author):

  • Update to 0.0.1 release, and remove big scary warning
  • Add syslog.d and newsyslog.conf.d entries
  • Add default config with syslog output enabled
  • Update rc script to interpret redirect any stdout/stderr as LOG_ALERT
  • Update dependencies
  • Add pkg-message explaining steps required after first install

For the record, the only dependencies I haven't included in the Makefile are the last 4 entries in Gopkg.lock (

It appears to work perfectly without adding anything related to these:

  branch = "master"
  name = ""
  packages = ["unix"]
  revision = "429f518978ab01db8bb6f44b66785088e7fba58b"

  branch = "master"
  name = ""
  packages = ["internal/gen","internal/triegen","internal/ucd","transform","unicode/cldr","unicode/norm"]
  revision = "1cbadb444a806fd9430d14ad08967ed91da4fa0a"

  branch = "v2"
  name = ""
  packages = ["."]
  revision = "eb3733d160e74a9c7e442f435eb3bea458e1d19f"

  analyzer-name = "dep"
  analyzer-version = 1
  inputs-digest = "7ce2ead5225e4bb72a34132538171a649b26de574596e909730658ddbc904cd5"
  solver-name = "gps-cdcl"
solver-version = 1

I believe this is ready for committing to ports. @lifanov are you happy with my updates, and do you want to commit it? Alternatively, let me know if you are happy for me to commit it.

lifanov added a comment.EditedOct 1 2017, 2:26 PM

I'll take one last look at it and commit it in a few minutes. I hereby implicitly approve you (woodsb02) to make any sort of change to the port in the future including grabbing maintainership.

p.s. Sorry, I was traveling, just got back.

pkg-descr needs to start with a capital letter.
Also, it uses "written in Go" twice in the same sentence.

Closed by commit rP451047: new port: sysutils/zrepl (authored by lifanov, committed by ). · Explain WhyOct 1 2017, 2:44 PM
This revision was automatically updated to reflect the committed changes.
mat added inline comments.Oct 6 2017, 2:58 PM
2–3 ↗(On Diff #33602)

If the syslog.d file can be customized, I think the newsyslog.conf.d file shoudl be customizable too. (Note the newsyslog sample file needs to be some other place.)

woodsb02 added inline comments.Oct 6 2017, 4:24 PM
2–3 ↗(On Diff #33602)

I wanted to do this, but unlike syslogd which only includes .conf files, newsyslog include ALL files in the /usr/local/etc/newsyslog.conf.d/ directory.

Do you know if it is possible with package to put the .sample file in a different directory from the config file? It would violate POLA... but could work.

mat added inline comments.Oct 6 2017, 4:34 PM
2–3 ↗(On Diff #33602)
$ ag newsyslog sysutils/munin-node/
8:@dir etc/newsyslog.conf.d
9:@sample %%ETCDIR%%/munin-node.newsyslog etc/newsyslog.conf.d/munin-node

91:     ${INSTALL_DATA} ${FILESDIR}/newsyslog ${STAGEDIR}${ETCDIR}/munin-node.newsyslog
lifanov reopened this revision.Oct 6 2017, 5:29 PM

Ughh, sorry. I didn't think of that.
What do you think of adding a file in etc/newsyslog.conf.d that does something like
<include> %%LOCALBASE%%/etc/zrepl-newsyslog.conf
and install a sample for that?

mat added a comment.Oct 6 2017, 8:26 PM

Ughh, sorry. I didn't think of that.
What do you think of adding a file in etc/newsyslog.conf.d that does something like
<include> %%LOCALBASE%%/etc/zrepl-newsyslog.conf
and install a sample for that?

That seems like over-engineering. Why not simply install the sample file someplace else and use @sample to install it at the right place ?