From nobody Fri May 13 04:12:27 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B32851ACB58C; Fri, 13 May 2022 04:12:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KzwGM4Y7Zz4Vc5; Fri, 13 May 2022 04:12:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652415147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pWOKyTAd12+l6ToSlpdzfmkvY6Ar7fY+KR3e6ZmKJtg=; b=qc6ZDK39WN6sKwexYo6jbpfQAnk+UkbKaRNLWLI4s8m8klaNZfpWZxFj+v6YqlteUeYKbp YSjJy2cX6Q6O52IgPcLVUFxCri/TTX3iOK8g5AeibFxI6sVeMAk6kkjsf2NdH9lqeOzDgg hQLPwAY9FUOloCEVg8vuw0XqiMXcaN0P7flGSmpuCUuwc538POT6BmZKJPHTjCh/wNynW+ hHTj0VXLLdJmLPE7SwJ7lP3n7vZ0Av/w6gH+tIQlm9jrjsFzYAXizNnoNYXaYgDNdukqWw XuQYY/87t4unDWfg22H8Clc8KCaMwXtzCCqZCxi0NymnaYROYARp8WUUQi0xSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CFF81BB26; Fri, 13 May 2022 04:12:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 24D4CRpJ055643; Fri, 13 May 2022 04:12:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24D4CRYB055642; Fri, 13 May 2022 04:12:27 GMT (envelope-from git) Date: Fri, 13 May 2022 04:12:27 GMT Message-Id: <202205130412.24D4CRYB055642@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Ashish SHUKLA Subject: git: 94f671fb0ef2 - main - security/tailscale: Robustify rc.d script List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ashish X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 94f671fb0ef24b2b94a4b6d66228028a82e23b5d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652415147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pWOKyTAd12+l6ToSlpdzfmkvY6Ar7fY+KR3e6ZmKJtg=; b=qYfYfYj62zUWFIRR0OeHTvoXneEZ1DNtxrAgM7JyKH0QYy4p1JKyPi+AXb9/FwCwGm4bsK NipJAfp3QG/JtVHEYwem2l5etSi5AJvaIxyKBn+w1gIvWwZL2GOaHOHWnwlfWUds0kA0v9 xZrQmApsQv9e7bhd8IHx6WxL/j9P0FpOOuLi7ujsO53F2zuXcGrOfufg4EX9iL5NehBtXG HJ6ZPxHYhfEhEvCMuIwZY+9yvt56KyNnvz2dM/IDwR9Op+OeuiFY54dRPjd3g07PfhXneT KFJ0vLM6wfHolcWNJK6EzLYJHhSl/h3wCI4LR25xHSEDPfnouPVVh0Q8x8A1ag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652415147; a=rsa-sha256; cv=none; b=GxHquVy7dDo2WlB1NFHnHyhCfVFLMmaZGXZdoQkuiLUA72iEAieBItEXMTIEYIh8rKRP+m GcGlOKliabaz1lsnKCXwTd2vcPH8+UTgc4A5yOA3TF5Hah/IM/joxzhVRjFeWK2drSW4fh x5NLDxl5z0oqfnVzlb4/G6mrmQ/bWVGREU9gmYBhbYQ8Ay+lYXKm4pddeJbXjed7HKF3Mi S8wvtUcvZpMJTxZX52TBPpGlavADI6zp9B5d6qpalQAhscPGcWQI+cAOS3AaGIkOsU/+EN 2WPsx6NvRMv3toAAYfkXye6zUFZ4NXDuIW1uk2EMGkH6G3yXK84c3EWUWbxgtw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by ashish: URL: https://cgit.FreeBSD.org/ports/commit/?id=94f671fb0ef24b2b94a4b6d66228028a82e23b5d commit 94f671fb0ef24b2b94a4b6d66228028a82e23b5d Author: Ashish SHUKLA AuthorDate: 2022-05-11 04:37:09 +0000 Commit: Ashish SHUKLA CommitDate: 2022-05-13 04:11:09 +0000 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 --- security/tailscale/Makefile | 1 + security/tailscale/files/tailscaled.in | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/security/tailscale/Makefile b/security/tailscale/Makefile index 0a336ea028c9..93a2c9db290a 100644 --- a/security/tailscale/Makefile +++ b/security/tailscale/Makefile @@ -1,5 +1,6 @@ PORTNAME= tailscale PORTVERSION= 1.24.2 +PORTREVISION= 1 DISTVERSIONPREFIX= v CATEGORIES= security diff --git a/security/tailscale/files/tailscaled.in b/security/tailscale/files/tailscaled.in index b1cb480b92bc..9300e901357c 100644 --- a/security/tailscale/files/tailscaled.in +++ b/security/tailscale/files/tailscaled.in @@ -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} }