MCPcopy Index your code
hub / github.com/GoEdgeLab/EdgeNode / Start

Method Start

internal/utils/service_linux.go:37–51  ·  view source on GitHub ↗

Start 启动服务

()

Source from the content-addressed store, hash-verified

35
36// Start 启动服务
37func (this *ServiceManager) Start() error {
38 if os.Getgid() != 0 {
39 return errors.New("only root users can start the service")
40 }
41
42 if files.NewFile(systemdServiceFile).Exists() {
43 systemd, err := executils.LookPath("systemctl")
44 if err != nil {
45 return err
46 }
47
48 return exec.Command(systemd, "start", teaconst.SystemdServiceName+".service").Start()
49 }
50 return exec.Command("service", teaconst.ProcessName, "start").Start()
51}
52
53// Uninstall 删除服务
54func (this *ServiceManager) Uninstall() error {

Callers

nothing calls this directly

Calls 1

StartMethod · 0.65

Tested by

no test coverage detected