The service package now has a Linux implementation alongside the Windows one: systemd unit install/remove (/etc/systemd/system), readiness notification (READY=1 via go-systemd) sent only after the listeners are bound, a 30s watchdog, and STOPPING on shutdown. Listeners are pre-bound so port conflicts fail fast and the readiness signal is truthful. The notify calls are no-ops without NOTIFY_SOCKET (containers, shells) and on non-Linux builds. --install-service/--remove-service work on both platforms; the 'service install|remove' subcommand remains as an alias.
15 lines
297 B
Go
15 lines
297 B
Go
//go:build !linux
|
|
|
|
package service
|
|
|
|
import "context"
|
|
|
|
// NotifyReady is a no-op outside Linux (no systemd notify socket).
|
|
func NotifyReady() {}
|
|
|
|
// NotifyStopping is a no-op outside Linux.
|
|
func NotifyStopping() {}
|
|
|
|
// StartWatchdog is a no-op outside Linux.
|
|
func StartWatchdog(context.Context) {}
|