diff options
author | Simon Rozman <simon@rozman.si> | 2019-06-05 10:42:50 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-06-07 11:31:53 +0200 |
commit | 6f15adbf30c94a078f84b4b8e362e339547a1464 (patch) | |
tree | a3aac23172ffb13a9024df8984f7ba840107f83d | |
parent | ui: get rid of hacks in tunnelspage (diff) | |
download | wireguard-windows-6f15adbf30c94a078f84b4b8e362e339547a1464.tar.xz wireguard-windows-6f15adbf30c94a078f84b4b8e362e339547a1464.zip |
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 <simon@rozman.si>
-rw-r--r-- | tunnel/service.go | 4 |
1 files changed, 2 insertions, 2 deletions
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 |