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

Method Operate

agent/utils/controller/manager/systemd.go:59–71  ·  view source on GitHub ↗
(operate, serviceName string)

Source from the content-addressed store, hash-verified

57 return run(s.toolCmd, "status", serviceName)
58}
59func (s *Systemd) Operate(operate, serviceName string) error {
60 out, err := run(s.toolCmd, operate, serviceName)
61 if err != nil {
62 if fallbackName := systemdAliasFallbackName(serviceName); fallbackName != "" && strings.Contains(out, "alias name or linked unit file") {
63 return s.Operate(operate, fallbackName)
64 }
65 if err := NewSnap().Operate(operate, serviceName); err == nil {
66 return nil
67 }
68 return handlerErr(run(s.toolCmd, operate, serviceName))
69 }
70 return nil
71}
72
73func (s *Systemd) Reload() error {
74 out, err := run(s.toolCmd, "daemon-reload")

Callers

nothing calls this directly

Calls 5

systemdAliasFallbackNameFunction · 0.85
runFunction · 0.70
NewSnapFunction · 0.70
handlerErrFunction · 0.70
OperateMethod · 0.65

Tested by

no test coverage detected