Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F136823291
D18533.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D18533.diff
View Options
Index: head/net/zerotier/Makefile
===================================================================
--- head/net/zerotier/Makefile
+++ head/net/zerotier/Makefile
@@ -3,7 +3,7 @@
PORTNAME= zerotier
DISTVERSION= 1.2.12
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= net
MAINTAINER= dch@FreeBSD.org
@@ -36,6 +36,12 @@
SUB_LIST+= ZEROTIER_SYSLOG="-s debug -T zerotier"
.else
SUB_LIST+= ZEROTIER_SYSLOG=""
+.endif
+# after r347241 tun(4) and tap(4) have been merged to tuntap(4)
+.if (${OSVERSION} >= 1300028)
+SUB_LIST+= ZEROTIER_IF_TAP="if_tuntap"
+.else
+SUB_LIST+= ZEROTIER_IF_TAP="if_tap"
.endif
.endif
Index: head/net/zerotier/files/zerotier.in
===================================================================
--- head/net/zerotier/files/zerotier.in
+++ head/net/zerotier/files/zerotier.in
@@ -12,29 +12,51 @@
#
# zerotier_enable (bool): Set to NO by default.
# Set it to YES to enable zerotier.
+# zerotier_wait_for_net (bool): Set to NO by default. Use for DHCP interfaces only
+# Set it to YES to require zerotier to wait until online
. /etc/rc.subr
name=zerotier
rcvar=zerotier_enable
+desc="peer-to-peer software-defined networking"
load_rc_config $name
-: ${zerotier_enable:="NO"}
+: ${zerotier_enable:=NO}
+: ${zerotier_wait_for_net:=NO}
-required_modules="if_tap"
+required_modules=%%ZEROTIER_IF_TAP%%
pidfile="/var/run/${name}.pid"
start_precmd="install -o root /dev/null ${pidfile}"
-command="/usr/sbin/daemon"
+command=/usr/sbin/daemon
command_args=" \
-c \
-t ${name} \
-r \
-P ${pidfile} \
%%ZEROTIER_SYSLOG%% \
- /usr/local/sbin/${name}-one"
+ %%PREFIX%%/sbin/${name}-one /var/db/${name}-one/"
-run_rc_command "$1"
+start_postcmd=start_postcmd
+start_postcmd()
+{ if checkyesno zerotier_wait_for_net; then
+ zerotier_count=5
+ until %%PREFIX%%/bin/zerotier-cli status |egrep -o ONLINE\$; do
+ warn ${name} is waiting for ONLINE status
+ sleep 2
+ zerotier_count=$((zerotier_count-1))
+ test $zerotier_count -le 0 && break
+ done
+ if test $zerotier_count -le 0; then
+ warn ${name} still not ONLINE, stopped blocking
+ else
+ warn ${name} is ONLINE
+ fi
+ fi
+}
+
+run_rc_command "$1"
Index: head/net/zerotier/pkg-message
===================================================================
--- head/net/zerotier/pkg-message
+++ head/net/zerotier/pkg-message
@@ -17,4 +17,14 @@
This avoids a race condition where zerotier interfaces are created, but
not up, prior to firewalls and services trying to use them.
+You can place optional configuration in /var/db/zerotier-one/local.conf
+as required, see documentation at https://www.zerotier.com/manual.shtml
+
+If your system boots from DHCP (such as a laptop), there is a new rc.conf
+flag that will require that system startup will wait until the zerotier
+network is established before proceeding. Note that this flag *does not*
+work for systems confgured with statically assigned IP addresses, and
+these will hang indefinitely due to an irreducible loop in rc(8) startup
+files. This flag is disabled by default.
+
#################################
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 20, 8:48 PM (7 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25740109
Default Alt Text
D18533.diff (3 KB)
Attached To
Mode
D18533: net/zerotier: wait for ONLINE status before booting
Attached
Detach File
Event Timeline
Log In to Comment