//go:build !windows && !linux // Package service provides the stubs for platforms without service // integration (Windows uses the SCM, Linux uses systemd). Run falls back // to plain signal handling; install/remove are unsupported. package service import ( "context" "errors" "os/signal" "syscall" ) // Name matches the Windows service name. const Name = "gpu-turnstile" var errUnsupported = errors.New("service management is only supported on Windows and Linux (systemd)") // IsService is always false on non-Windows platforms. func IsService() bool { return false } // Run executes run with SIGINT/SIGTERM cancellation, mirroring the // interactive behavior. func Run(run func(ctx context.Context) error) error { ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) defer stop() return run(ctx) } // Install is unsupported on non-Windows platforms. func Install(string) error { return errUnsupported } // Remove is unsupported on non-Windows platforms. func Remove() error { return errUnsupported }