diff options
| author | KubeEdge Bot <48982446+kubeedge-bot@users.noreply.github.com> | 2023-10-24 19:03:08 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-24 19:03:08 +0800 |
| commit | 36eb7a5ec22f5cbc59e6e4ed247529bed245ee2a (patch) | |
| tree | 3e2e66f3d1310bafd2e2c55589288f6f82c3f474 | |
| parent | Merge pull request #5106 from Shelley-BaoYue/automated-cherry-pick-of-#5045-u... (diff) | |
| parent | fix keadm upgrade If edgecore is stopped, the keadm process will stop (diff) | |
| download | kubeedge-36eb7a5ec22f5cbc59e6e4ed247529bed245ee2a.tar.gz | |
Merge pull request #5108 from wlq1212/automated-cherry-pick-of-#5085-upstream-release-1.12v1.12.5
Automated cherry pick of #5085: fix keadm upgrade If edgecore is stopped, the keadm process
| -rw-r--r-- | edge/pkg/edgehub/upgrade/upgrade.go | 4 | ||||
| -rw-r--r-- | keadm/cmd/keadm/app/cmd/common/content.go | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/edge/pkg/edgehub/upgrade/upgrade.go b/edge/pkg/edgehub/upgrade/upgrade.go index a8dd19d21..3a7ecfcd2 100644 --- a/edge/pkg/edgehub/upgrade/upgrade.go +++ b/edge/pkg/edgehub/upgrade/upgrade.go @@ -138,8 +138,8 @@ func (*keadmUpgrade) Upgrade(upgradeReq *commontypes.NodeUpgradeJobRequest) erro upgradeReq.UpgradeID, upgradeReq.HistoryID, version.Get(), upgradeReq.Version, opts.ConfigFile, image) // run upgrade cmd to upgrade edge node - // use setsid command and nohup command to start a separate progress - command := fmt.Sprintf("setsid nohup %s &", upgradeCmd) + // use nohup command to start a child progress + command := fmt.Sprintf("nohup %s &", upgradeCmd) cmd := exec.Command("bash", "-c", command) s, err := cmd.CombinedOutput() if err != nil { diff --git a/keadm/cmd/keadm/app/cmd/common/content.go b/keadm/cmd/keadm/app/cmd/common/content.go index 56cc759ea..bdd7eab5f 100644 --- a/keadm/cmd/keadm/app/cmd/common/content.go +++ b/keadm/cmd/keadm/app/cmd/common/content.go @@ -35,6 +35,7 @@ Restart=always RestartSec=10 Environment=%s Environment=%s +KillMode=process [Install] WantedBy=multi-user.target |
