diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go index 10f0fa3cb..84bdd4136 100644 --- a/ipn/ipnlocal/local.go +++ b/ipn/ipnlocal/local.go @@ -757,6 +757,12 @@ func (b *LocalBackend) Start(opts ipn.Options) error { newPrefs := opts.UpdatePrefs newPrefs.Persist = b.prefs.Persist b.prefs = newPrefs + + if opts.StateKey != "" { + if err := b.store.WriteState(opts.StateKey, b.prefs.ToBytes()); err != nil { + b.logf("failed to save UpdatePrefs state: %v", err) + } + } } wantRunning := b.prefs.WantRunning