feat(cmd): add start, stop, uninstall, and update commands
This commit is contained in:
@@ -73,6 +73,16 @@ func Disable(u config.Unit, prefix, suffix string) error {
|
||||
return systemctl(u.User, "disable", "--now", ServiceName(u, prefix, suffix))
|
||||
}
|
||||
|
||||
// Start starts a unit without enabling it.
|
||||
func Start(u config.Unit, prefix, suffix string) error {
|
||||
return systemctl(u.User, "start", ServiceName(u, prefix, suffix))
|
||||
}
|
||||
|
||||
// Stop stops a unit without disabling it.
|
||||
func Stop(u config.Unit, prefix, suffix string) error {
|
||||
return systemctl(u.User, "stop", ServiceName(u, prefix, suffix))
|
||||
}
|
||||
|
||||
// Status returns the ActiveState of a unit ("active", "inactive", "failed", "unknown").
|
||||
func Status(u config.Unit, prefix, suffix string) string {
|
||||
args := []string{"show", "-p", "ActiveState", "--value", ServiceName(u, prefix, suffix)}
|
||||
|
||||
Reference in New Issue
Block a user