diff --git a/.golangci.yml b/.golangci.yml index 88168af22..0d7f90e26 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -110,3 +110,7 @@ issues: - text: "exitAfterDefer:" linters: - gocritic + - path: modules/graceful/manager_windows.go + linters: + - staticcheck + text: "svc.IsAnInteractiveSession is deprecated: Use IsWindowsService instead." diff --git a/modules/graceful/manager_windows.go b/modules/graceful/manager_windows.go index b0e0d1ce3..14923c2a9 100644 --- a/modules/graceful/manager_windows.go +++ b/modules/graceful/manager_windows.go @@ -74,12 +74,14 @@ func (g *Manager) start() { // Make SVC process run := svc.Run - isWindowsService, err := svc.IsWindowsService() + + //lint:ignore SA1019 We use IsAnInteractiveSession because IsWindowsService has a different permissions profile + isAnInteractiveSession, err := svc.IsAnInteractiveSession() if err != nil { log.Error("Unable to ascertain if running as an Windows Service: %v", err) return } - if !isWindowsService { + if isAnInteractiveSession { log.Trace("Not running a service ... using the debug SVC manager") run = debug.Run }