MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / Operate

Method Operate

core/utils/controller/manager/systemd.go:63–75  ·  view source on GitHub ↗
(operate, serviceName string)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

runFunction · 0.70
NewSnapFunction · 0.70
handlerErrFunction · 0.70
OperateMethod · 0.65

Tested by

no test coverage detected