Index: Makefile =================================================================== --- Makefile +++ Makefile @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= zerotier -DISTVERSION= 1.2.8 +DISTVERSION= 1.2.10 CATEGORIES= net MAINTAINER= dch@FreeBSD.org @@ -29,10 +29,23 @@ PLIST_FILES= bin/zerotier-cli bin/zerotier-idtool sbin/zerotier-one +# log output via syslog when daemon(8) supports it +SUB_FILES= zerotier + +.include + +.if ${OPSYS} == "FreeBSD" +.if ((${OSVERSION} >= 1100513 && ${OSVERSION} < 1200000) || ${OSVERSION} >= 1200015) +SUB_LIST+= ZEROTIER_SYSLOG="-s debug -T zerotier" +.else +SUB_LIST+= ZEROTIER_SYSLOG="" +.endif +.endif + do-install: ${INSTALL_PROGRAM} ${WRKSRC}/zerotier-one ${STAGEDIR}${PREFIX}/sbin/ .for l in zerotier-cli zerotier-idtool - ${LN} -sf ../sbin/zerotier-one ${STAGEDIR}${PREFIX}/bin/${l} + ${RLN} ${STAGEDIR}${PREFIX}/sbin/zerotier-one ${STAGEDIR}${PREFIX}/bin/${l} .endfor -.include +.include Index: distinfo =================================================================== --- distinfo +++ distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1525679369 -SHA256 (zerotier-ZeroTierOne-1.2.8_GH0.tar.gz) = 08e2df34550d6bb68e106eaac48babb481160046818b0944ec41f1e158548a47 -SIZE (zerotier-ZeroTierOne-1.2.8_GH0.tar.gz) = 6009764 +TIMESTAMP = 1529964792 +SHA256 (zerotier-ZeroTierOne-1.2.10_GH0.tar.gz) = 1c79ec57e67764079a77704b336e642ae3cf221dc8088b0cf9e9c81e0a9c0c57 +SIZE (zerotier-ZeroTierOne-1.2.10_GH0.tar.gz) = 6056935 Index: files/zerotier.in =================================================================== --- files/zerotier.in +++ files/zerotier.in @@ -3,8 +3,8 @@ # $FreeBSD$ # # PROVIDE: zerotier -# REQUIRE: FILESYSTEMS netif -# BEFORE: pf ipfw ipfilter +# REQUIRE: FILESYSTEMS devfs +# BEFORE: pf ipfw # KEYWORD: shutdown # # Add these lines to /etc/rc.conf.local or /etc/rc.conf @@ -22,8 +22,19 @@ : ${zerotier_enable:="NO"} -command=%%PREFIX%%/sbin/${name}-one +required_modules="if_tap" -command_args="-d" +pidfile="/var/run/${name}.pid" +start_precmd="install -o root /dev/null ${pidfile}" +command="/usr/sbin/daemon" +command_args=" \ + -c \ + -t ${name} \ + -r \ + -P ${pidfile} \ + %%ZEROTIER_SYSLOG%% \ + /usr/local/sbin/${name}-one" + run_rc_command "$1" + Index: pkg-message =================================================================== --- pkg-message +++ pkg-message @@ -8,4 +8,13 @@ zerotier-cli join +If you are running other daemons or require firewall rules to depend on +zerotier interfaces being available at startup, you may need to enable +the following sysctl in /etc/sysctl.conf: + +net.link.tap.up_on_open=1 + +This avoids a race condition where zerotier interfaces are created, but +not up, prior to firewalls and services trying to use them. + #################################