git: ca9dfde0e1f1 - main - security/tailscale: Refactor rc.d script
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 27 Jan 2026 22:55:59 UTC
The branch main has been updated by ashish:
URL: https://cgit.FreeBSD.org/ports/commit/?id=ca9dfde0e1f1cf4bf87e7ceae30ab34b5c2a7f09
commit ca9dfde0e1f1cf4bf87e7ceae30ab34b5c2a7f09
Author: R Williams <ross@ross-williams.net>
AuthorDate: 2026-01-27 21:57:25 +0000
Commit: Ashish SHUKLA <ashish@FreeBSD.org>
CommitDate: 2026-01-27 22:54:04 +0000
security/tailscale: Refactor rc.d script
Refactor rc.d script so various rc.conf variables such as ${name}_nice
and ${name}_oomprotect can be used
PR: 292220
MFH: 2026Q1
---
security/tailscale/files/tailscaled.in | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/security/tailscale/files/tailscaled.in b/security/tailscale/files/tailscaled.in
index 1ffd6f41347c..085eb1367774 100644
--- a/security/tailscale/files/tailscaled.in
+++ b/security/tailscale/files/tailscaled.in
@@ -50,8 +50,7 @@ load_rc_config $name
: ${tailscaled_up_args:=""}
: ${tailscaled_tun_dev:="tailscale0"}
-DAEMON=$(/usr/sbin/daemon 2>&1 | grep -q syslog ; echo $?)
-if [ ${DAEMON} -eq 0 ]; then
+if /usr/sbin/daemon 2>&1 | grep -q syslog; then
: ${tailscaled_syslog_output_enable:="NO"}
: ${tailscaled_syslog_output_priority:="info"}
: ${tailscaled_syslog_output_facility:="daemon"}
@@ -71,15 +70,23 @@ else
tailscaled_syslog_output_flags=""
fi
+if ! checkyesno tailscaled_telemetry_enable; then
+ tailscaled_telemetry_flags="--no-logs-no-support"
+else
+ tailscaled_telemetry_flags=""
+fi
+
pidfile=/var/run/${name}.pid
procname="%%PREFIX%%/bin/${name}"
ctlname="%%PREFIX%%/bin/tailscale"
+command="/usr/sbin/daemon"
+command_args="-f ${tailscaled_syslog_output_flags} -p ${pidfile} ${procname} -port ${tailscaled_port} -tun ${tailscaled_tun_dev} -statedir ${tailscaled_state_dir} ${tailscaled_telemetry_flags} ${tailscaled_args}"
-start_cmd="${name}_start"
+start_precmd="${name}_prestart"
start_postcmd="${name}_poststart"
stop_postcmd="${name}_poststop"
-tailscaled_start()
+tailscaled_prestart()
{
# Check for orphaned tailscale network interface
# And if it exists, then destroy it
@@ -89,11 +96,8 @@ tailscaled_start()
)
if ! checkyesno tailscaled_telemetry_enable; then
- logger -s -t tailscale "Opting out of client logging telemetry."
- tailscaled_args=" --no-logs-no-support ${tailscaled_args}"
+ logger -s -t tailscale "Opting out of client logging telemetry."
fi
-
- /usr/sbin/daemon -f ${tailscaled_syslog_output_flags} -p ${pidfile} ${procname} -port ${tailscaled_port} -tun ${tailscaled_tun_dev} -statedir ${tailscaled_state_dir} ${tailscaled_args}
}
tailscaled_poststart()