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

Method IsActive

agent/utils/controller/manager/systemd.go:16–25  ·  view source on GitHub ↗
(serviceName string)

Source from the content-addressed store, hash-verified

14 return "systemd"
15}
16func (s *Systemd) IsActive(serviceName string) (bool, error) {
17 out, err := run(s.toolCmd, "is-active", serviceName)
18 if err != nil && out != "inactive\n" {
19 if NewSnap().IsActive(serviceName) {
20 return true, nil
21 }
22 return false, err
23 }
24 return out == "active\n", nil
25}
26
27func (s *Systemd) IsEnable(serviceName string) (bool, error) {
28 out, err := run(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