MCPcopy Index your code
hub / github.com/1Panel-dev/1Panel / IsActive

Method IsActive

core/utils/controller/manager/systemd.go:21–30  ·  view source on GitHub ↗
(serviceName string)

Source from the content-addressed store, hash-verified

19 return "systemd"
20}
21func (s *Systemd) IsActive(serviceName string) (bool, error) {
22 out, err := run(s.Client, s.toolCmd, "is-active", serviceName)
23 if err != nil && out != "inactive\n" {
24 if NewSnap().IsActive(serviceName) {
25 return true, nil
26 }
27 return false, err
28 }
29 return out == "active\n", nil
30}
31
32func (s *Systemd) IsEnable(serviceName string) (bool, error) {
33 out, err := run(s.Client, s.toolCmd, "is-enabled", serviceName)

Callers

nothing calls this directly

Calls 3

runFunction · 0.70
NewSnapFunction · 0.70
IsActiveMethod · 0.65

Tested by

no test coverage detected