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

Method Install

internal/utils/service_linux.go:23–34  ·  view source on GitHub ↗

Install 安装服务

(exePath string, args []string)

Source from the content-addressed store, hash-verified

21
22// Install 安装服务
23func (this *ServiceManager) Install(exePath string, args []string) error {
24 if os.Getgid() != 0 {
25 return errors.New("only root users can install the service")
26 }
27
28 systemd, err := executils.LookPath("systemctl")
29 if err != nil {
30 return this.installInitService(exePath, args)
31 }
32
33 return this.installSystemdService(systemd, exePath, args)
34}
35
36// Start 启动服务
37func (this *ServiceManager) Start() error {

Callers 2

InstallSystemServiceMethod · 0.95
setupSystemdMethod · 0.45

Calls 2

installInitServiceMethod · 0.95
installSystemdServiceMethod · 0.95

Tested by

no test coverage detected