Skip to content
Snippets Groups Projects
Unverified Commit 94f671fb authored by Ashish SHUKLA's avatar Ashish SHUKLA
Browse files

security/tailscale: Robustify rc.d script

Check for orphaned network interface at the time of start, and if such
an interface exists then destroy it before starting tailscaled. When
tailscaled terminates unexpectedly it fails to cleanup, leaving the
orphaned interface behind. This results in it failing to start until
the interface is cleaned up, making it unsuitable for being monitored
by a service monitoring software (e.g. monit)

Reported by:	ler
parent 1430dabd
No related branches found
No related tags found
No related merge requests found
PORTNAME= tailscale
PORTVERSION= 1.24.2
PORTREVISION= 1
DISTVERSIONPREFIX= v
CATEGORIES= security
......
......@@ -65,6 +65,12 @@ stop_postcmd="${name}_poststop"
tailscaled_start()
{
# Check for orphaned tailscale network interface
# And if it exists, then destroy it
/sbin/ifconfig ${tailscale_tap_dev} >/dev/null 2>&1 && (
/sbin/ifconfig ${tailscale_tap_dev} | fgrep -qw PID ||
/sbin/ifconfig ${tailscale_tap_dev} destroy
)
env CACHE_DIRECTORY=/var/db/tailscale /usr/sbin/daemon -f ${tailscaled_syslog_output_flags} -p ${pidfile} ${procname} --port ${tailscaled_port}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment