InstallSystemService 安装系统服务
()
| 300 | |
| 301 | // InstallSystemService 安装系统服务 |
| 302 | func (this *Node) InstallSystemService() error { |
| 303 | shortName := teaconst.SystemdServiceName |
| 304 | |
| 305 | exe, err := os.Executable() |
| 306 | if err != nil { |
| 307 | return err |
| 308 | } |
| 309 | |
| 310 | manager := utils.NewServiceManager(shortName, teaconst.ProductName) |
| 311 | err = manager.Install(exe, []string{}) |
| 312 | if err != nil { |
| 313 | return err |
| 314 | } |
| 315 | return nil |
| 316 | } |
| 317 | |
| 318 | // 读取API配置 |
| 319 | func (this *Node) syncConfig(taskVersion int64) error { |
no test coverage detected