Documentation
¶
Index ¶
- func DisableService(name string) error
- func EnableService(name string) error
- func GetUnit(name string) (string, error)
- func IsServiceActive(name string) bool
- func IsServiceActiveOrRestarting(name string) bool
- func IsServiceEnabled(name string) bool
- func RestartService(name string) error
- func StartService(name string) error
- func WriteService(name, content string) error
- func WriteServiceIfChanged(name, content string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableService ¶ added in v0.3.0
DisableService disables a systemd user service.
func EnableService ¶
EnableService enables a systemd user service.
func IsServiceActive ¶ added in v1.0.0
IsServiceActive returns true if the systemd user service is currently active.
func IsServiceActiveOrRestarting ¶ added in v1.5.0
IsServiceActiveOrRestarting returns true if the service is active or in a restart loop (activating). Used to detect workers that should be stopped on unlink.
func IsServiceEnabled ¶ added in v0.3.0
IsServiceEnabled returns true if the systemd user service is enabled.
func RestartService ¶ added in v0.6.0
RestartService restarts a systemd user service.
func StartService ¶
StartService starts a systemd user service.
func WriteService ¶
WriteService writes a systemd user service unit file.
func WriteServiceIfChanged ¶ added in v0.8.0
WriteServiceIfChanged writes the unit file only when the content differs from what is already on disk. Returns true if the file was written (caller should run daemon-reload), false if it was unchanged (daemon-reload not needed).
Types ¶
This section is empty.