From ec841c480f6ea7b8aff7768a14b24f55988c6e25 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 5 Jun 2019 10:42:50 +0200 Subject: tunnel: perform full stop on shutdown The services which do not advertise they accept shutdown signal from SCM are killed on shutdown. This commit establishes a full tunnel cleanup (i.e. delete the adapter) on shutdown. Otherwise, the Wintun adapter is deleted on next boot as a part of the regular sanitation procedure. Signed-off-by: Simon Rozman --- tunnel/service.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tunnel/service.go') diff --git a/tunnel/service.go b/tunnel/service.go index dbf0dd6e..5c1cc13e 100644 --- a/tunnel/service.go +++ b/tunnel/service.go @@ -211,14 +211,14 @@ func (service *Service) Execute(args []string, r <-chan svc.ChangeRequest, chang } }() - changes <- svc.Status{State: svc.Running, Accepts: svc.AcceptStop} + changes <- svc.Status{State: svc.Running, Accepts: svc.AcceptStop | svc.AcceptShutdown} log.Println("Startup complete") for { select { case c := <-r: switch c.Cmd { - case svc.Stop: + case svc.Stop, svc.Shutdown: return case svc.Interrogate: changes <- c.CurrentStatus -- cgit v1.2.3-59-g8ed1b