mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-23 15:10:25 +08:00
使用自定义 executils.LookPath() 代替 exec.LookPath() 避免因$PATH环境变量被破坏而无法工作
This commit is contained in:
@@ -3,6 +3,7 @@ package apps
|
||||
import (
|
||||
"fmt"
|
||||
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
|
||||
executils "github.com/TeaOSLab/EdgeNode/internal/utils/exec"
|
||||
"github.com/iwind/TeaGo/logs"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
@@ -215,7 +216,7 @@ func (this *AppCmd) runStop() {
|
||||
|
||||
// 从systemd中停止
|
||||
if runtime.GOOS == "linux" {
|
||||
systemctl, _ := exec.LookPath("systemctl")
|
||||
systemctl, _ := executils.LookPath("systemctl")
|
||||
if len(systemctl) > 0 {
|
||||
go func() {
|
||||
// 有可能会长时间执行,这里不阻塞进程
|
||||
|
||||
Reference in New Issue
Block a user