diff options
| author | liqing.wu <liqing.wu@daoclod.io> | 2023-10-13 17:58:52 +0800 |
|---|---|---|
| committer | liqing.wu <liqing.wu@daoclod.io> | 2023-10-24 13:38:13 +0800 |
| commit | 7d891d77416363bf511ea920cf4c9073aeeac6f8 (patch) | |
| tree | 7317a2206b8d9c65fb99df8e52ef19b06b39f641 | |
| parent | Merge pull request #5076 from Shelley-BaoYue/automated-cherry-pick-of-#5063-u... (diff) | |
| download | kubeedge-7d891d77416363bf511ea920cf4c9073aeeac6f8.tar.gz | |
fix keadm upgrade If edgecore is stopped, the keadm process will stop
Signed-off-by: liqing.wu <liqing.wu@daoclod.io>
| -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 18db7682c..52a598872 100644 --- a/keadm/cmd/keadm/app/cmd/common/content.go +++ b/keadm/cmd/keadm/app/cmd/common/content.go @@ -34,6 +34,7 @@ ExecStart=%s Restart=always RestartSec=10 Environment=%s +KillMode=process [Install] WantedBy=multi-user.target |
