From f86c320c0ac003366813fa8bf8ad28f7d35d44ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Przychodze=C5=84?= Date: Mon, 30 Mar 2020 12:35:58 +0200 Subject: [PATCH] Revert "[NodeKiller] Schedule reboot and disconnect from node" This reverts commit f1647f4e3c1f05c29c5d04596a876371893420b7. --- clusterloader2/pkg/chaos/nodes.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/clusterloader2/pkg/chaos/nodes.go b/clusterloader2/pkg/chaos/nodes.go index fc5c6fb22b..e00c2d8645 100644 --- a/clusterloader2/pkg/chaos/nodes.go +++ b/clusterloader2/pkg/chaos/nodes.go @@ -164,19 +164,8 @@ func (k *NodeKiller) kill(nodes []v1.Node, stopCh <-chan struct{}) { sleepInterrupt(time.Duration(k.config.SimulatedDowntime), stopCh) klog.Infof("%s: Rebooting %q to repair the node", k, node.Name) - // Scheduling a reboot in one second, then disconnecting. - // - // Bash command explanation: - // 'nohup' - Making sure that end of SSH connection signal will not break sudo - // 'sudo' - Elevated priviliages, required by 'shutdown' - // 'shutdown' - Control machine power - // '-r' - Making 'shutdown' to reboot, instead of power-off - // '+1s' - Parameter to 'reboot', to wait 1 second before rebooting. - // '> /dev/null 2> /dev/null < /dev/null' - File descriptor redirect, all three I/O to avoid ssh hanging, - // see https://web.archive.org/web/20090429074212/http://www.openssh.com/faq.html#3.10 - // '&' - Execute command in background, end without waiting for result k.addRebootEvent(node.Name) - err = util.SSH("nohup sudo shutdown -r +1s > /dev/null 2> /dev/null < /dev/null &", &node, nil) + err = util.SSH("sudo reboot", &node, nil) if err != nil { klog.Errorf("%s: Error while rebooting node %q: %v", k, node.Name, err) return