tailscale/cmd/tailscaled
Aaron Klotz d915e0054c cmd/tailscaled: change Windows service shutdown and add optional event logging
Once a stop request is received and the service updates its status to `svc.StopPending`,
it should continue running *until the shutdown sequence is complete*, and then
return out of `(*ipnService).Execute`, which automatically sends a `svc.Stopped`
notification to Windows.

To make this happen, I changed the loop so that it runs until `doneCh` is
closed, and then returns. I also removed a spurious `svc.StopPending` notification
that the Windows Service Control Manager might be interpreting as a request for
more time to shut down.

Finally, I added some optional logging that sends a record of service notifications
to the Windows event log, allowing us to more easily correlate with any Service
Control Manager errors that are sent to the same log.

Change-Id: I5b596122e5e89c4c655fe747a612a52cb4e8f1e0
Signed-off-by: Aaron Klotz <aaron@tailscale.com>
2022-04-29 15:13:11 -07:00
..
childproc cmd/tailscaled/childproc: add be-child registration mechanism 2022-02-24 14:20:20 -08:00
debug.go cmd/tailscaled: make build fail nicely on older Go versions 2022-03-18 08:25:51 -07:00
depaware.txt cmd/tailscaled: change Windows service shutdown and add optional event logging 2022-04-29 15:13:11 -07:00
install_darwin.go cmd/tailscaled: make build fail nicely on older Go versions 2022-03-18 08:25:51 -07:00
install_windows.go cmd/tailscaled: make build fail nicely on older Go versions 2022-03-18 08:25:51 -07:00
proxy.go cmd/tailscaled: make build fail nicely on older Go versions 2022-03-18 08:25:51 -07:00
required_version.go cmd/tailscaled: make build fail nicely on older Go versions 2022-03-18 08:25:51 -07:00
ssh.go all: gofmt all 2022-04-29 13:06:04 -07:00
tailscaled_bird.go cmd/tailscaled: make build fail nicely on older Go versions 2022-03-18 08:25:51 -07:00
tailscaled_notwindows.go cmd/tailscaled: make build fail nicely on older Go versions 2022-03-18 08:25:51 -07:00
tailscaled_test.go cmd/tailscaled: add a no-op test for profiling init-time memory allocs 2022-02-24 14:58:12 -08:00
tailscaled_windows.go cmd/tailscaled: change Windows service shutdown and add optional event logging 2022-04-29 15:13:11 -07:00
tailscaled.defaults cmd/tailscaled: rename relaynode reference in defaults file comment 2020-03-13 14:38:04 -07:00
tailscaled.go net/tsdial: add SystemDial as a wrapper on netns.Dial 2022-04-27 12:02:36 -07:00
tailscaled.openrc tstest/integration/vms: use an in-process logcatcher (#2360) 2021-07-08 14:39:45 -04:00
tailscaled.service cmd/tailscaled: set StateDirectoryMode=0700 in tailscaled.service 2021-09-28 09:09:24 -07:00