include 3 upstream bugs related to large environments: - Fix bug loading moons.d/ files for federated root operation. - Fix compile problem with ZT_DEBUG on some versions of clang - Fix slow network startup bug related to loading of networks.d/ cache files improve daemon functionality: - improve rc.d dependencies by requiring devfs instead of netif - use daemon(8) to capture debug logging to syslog if > FreeBSD 11.1R and if compiled with debugging option - let rc.d script load if_tap if not already present - add reminder for users about sysctls to avoid race conditions at boot time Reviewed by: mat Approved by: jrm Differential Revision: https://reviews.freebsd.org/D15534
40 lines
663 B
Bash
40 lines
663 B
Bash
#!/bin/sh
|
|
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: zerotier
|
|
# REQUIRE: FILESYSTEMS devfs
|
|
# BEFORE: pf ipfw
|
|
# KEYWORD: shutdown
|
|
#
|
|
# Add these lines to /etc/rc.conf.local or /etc/rc.conf
|
|
# to enable this service:
|
|
#
|
|
# zerotier_enable (bool): Set to NO by default.
|
|
# Set it to YES to enable zerotier.
|
|
|
|
. /etc/rc.subr
|
|
|
|
name=zerotier
|
|
rcvar=zerotier_enable
|
|
|
|
load_rc_config $name
|
|
|
|
: ${zerotier_enable:="NO"}
|
|
|
|
required_modules="if_tap"
|
|
|
|
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"
|
|
|