From a8378476ba62b00c8af42ab8dcb743135b86742e Mon Sep 17 00:00:00 2001 From: tom Date: Thu, 26 Dec 2024 21:13:59 +0800 Subject: [PATCH] Ignore tun config without permission --- adapter/inbound/manager.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/adapter/inbound/manager.go b/adapter/inbound/manager.go index c690b2c9..6e0046fe 100644 --- a/adapter/inbound/manager.go +++ b/adapter/inbound/manager.go @@ -2,6 +2,7 @@ package inbound import ( "context" + "errors" "os" "sync" @@ -45,6 +46,11 @@ func (m *Manager) Start(stage adapter.StartStage) error { m.stage = stage for _, inbound := range m.inbounds { err := adapter.LegacyStart(inbound, stage) + if err != nil && errors.Is(err, os.ErrPermission) { + m.Remove(inbound.Tag()) + m.logger.Warn("inbound/", inbound.Type(), "[", inbound.Tag(), "]: ", err) + continue + } if err != nil { return E.Cause(err, stage, " inbound/", inbound.Type(), "[", inbound.Tag(), "]") }