diff --git a/cmd/core_plugin/oslogin/oslogin_linux.go b/cmd/core_plugin/oslogin/oslogin_linux.go index 30340bc..8df7a04 100644 --- a/cmd/core_plugin/oslogin/oslogin_linux.go +++ b/cmd/core_plugin/oslogin/oslogin_linux.go @@ -448,12 +448,6 @@ func (mod *osloginModule) osloginSetup(ctx context.Context, desc *metadata.Descr failed = true } - // Restart services. This is not a blocker. - if err := mod.restartServices(ctx); err != nil { - errs = errors.Join(errs, fmt.Errorf("failed to restart services: %w", err)) - failed = true - } - // Create the necessary OSLogin directories and other files. if err := mod.setupOSLoginDirs(ctx); err != nil { errs = errors.Join(errs, fmt.Errorf("failed to setup OSLogin directories: %w", err)) @@ -474,6 +468,12 @@ func (mod *osloginModule) osloginSetup(ctx context.Context, desc *metadata.Descr failed = true } + // Restart services. This is not a blocker. + if err := mod.restartServices(ctx); err != nil { + errs = errors.Join(errs, fmt.Errorf("failed to restart services: %w", err)) + failed = true + } + mod.enabled.Store(!failed) mod.failedConfiguration.Store(failed) return true, false, errs