2018-11-08 12:42:13 +00:00
|
|
|
package ser
|
|
|
|
|
2018-11-11 20:38:16 +00:00
|
|
|
import (
|
|
|
|
"git.xdrm.io/go/nix-amer/internal/exec"
|
|
|
|
)
|
|
|
|
|
2018-11-11 18:01:00 +00:00
|
|
|
// DefaultManager if not empty is the default service-manager to use when missing
|
2018-11-10 11:37:31 +00:00
|
|
|
var DefaultManager = "systemd"
|
|
|
|
|
2018-11-08 12:42:13 +00:00
|
|
|
// ServiceManager is the common interface for service managers (systemd, init.d)
|
|
|
|
type ServiceManager interface {
|
2018-11-11 20:38:16 +00:00
|
|
|
// SetExecContext sets the execution context, default is os/exec
|
|
|
|
SetExecutor(exec.Executor)
|
2018-11-08 12:42:13 +00:00
|
|
|
// Name of executable (to check if installed and for debug)
|
|
|
|
Name() string
|
|
|
|
// Exec a specific action on a service
|
|
|
|
Exec(action, service string) error
|
|
|
|
}
|