logpolicy: actually collect panics

(Written with Josh)

For #2544

Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
This commit is contained in:
David Crawshaw
2021-07-28 15:17:31 -07:00
committed by Josh Bleecher Snyder
parent 7298e777d4
commit 3e039daf95
3 changed files with 41 additions and 1 deletions

View File

@@ -210,6 +210,9 @@ func run() error {
logf = logger.RateLimitedFn(logf, 5*time.Second, 5, 100)
if args.cleanup {
if os.Getenv("TS_PLEASE_PANIC") != "" {
panic("TS_PLEASE_PANIC asked us to panic")
}
dns.Cleanup(logf, args.tunname)
router.Cleanup(logf, args.tunname)
return nil