From 1c2e55ed17f315619ef153dc458ab139c08f90ce Mon Sep 17 00:00:00 2001 From: niusmallnan Date: Thu, 25 Jan 2018 16:25:09 +0800 Subject: [PATCH] Fixes the following scenario can not reboot (#2236) 1. use ros install 2. use ros os upgrade --- cmd/power/power.go | 1 + cmd/power/shutdown.go | 1 + 2 files changed, 2 insertions(+) diff --git a/cmd/power/power.go b/cmd/power/power.go index 07e939a6..41e95444 100644 --- a/cmd/power/power.go +++ b/cmd/power/power.go @@ -39,6 +39,7 @@ func runDocker(name string) error { } cmd := os.Args + log.Debugf("runDocker cmd: %s", cmd) if name == "" { name = filepath.Base(os.Args[0]) diff --git a/cmd/power/shutdown.go b/cmd/power/shutdown.go index 65979a1d..3895179d 100644 --- a/cmd/power/shutdown.go +++ b/cmd/power/shutdown.go @@ -190,6 +190,7 @@ func Kexec(previous bool, bootDir, append string) error { // Reboot is used by installation / upgrade // TODO: add kexec option func Reboot() { + os.Args = []string{"reboot"} reboot("reboot", false, syscall.LINUX_REBOOT_CMD_RESTART) }