liuxiaolong
2019-12-17 6bbddc16d8497adcd633c30f7aeee0adb5433eb0
exec updatePatch.sh use setsid
2个文件已修改
6 ■■■■■ 已修改文件
controllers/syssetcont.go 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/SysService.go 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/syssetcont.go
@@ -9,6 +9,7 @@
    "webserver/extend/sys"
    "webserver/extend/util"
    "webserver/middlewares/auth"
    "webserver/service"
    "basic.com/dbapi.git"
    "github.com/gin-gonic/gin"
service/SysService.go
@@ -179,8 +179,9 @@
    }
    //2.更新系统
    var cmd *exec.Cmd
    cmd = exec.Command("/bin/sh","-c",fmt.Sprintf("./updatePatch.sh %s",unZipPath))
    logger.Debug("called sh updatePatch.sh ", unZipPath)
    updateCmd := fmt.Sprintf("setsid updatePatch.sh %s",unZipPath)
    cmd = exec.Command("/bin/sh","-c", updateCmd)
    logger.Debug("called sh updatePatch.sh,updateCmd:",updateCmd)
    if b, err := cmd.Output(); err != nil {
        logger.Debug("updatePatch err:",err,"result:",string(b))
        return false