From 2be276e714c4dbec652cbafbb23ea45e40cfdc96 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Thu, 1 Dec 2016 16:36:42 +0100 Subject: [PATCH] kernel: fix reboot into the new kernel on xenial shutdown is a symlink to systemctl on xenial, and on "shutdown -r now" network gets shut down before ssh has a chance to close gracefully. There have been multiple complaints about this and some distantly related fixes have made it into recent systemds [1]. This doesn't seem to happen on centos, probably because of different systemd versions or sshd configuration, so this band-aid is for ubuntu only. "systemctl --no-block reboot" is nicer, but not available on trusty. [1] https://github.com/systemd/systemd/issues/2390 Signed-off-by: Ilya Dryomov --- teuthology/task/kernel.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/teuthology/task/kernel.py b/teuthology/task/kernel.py index 9bfc775f84..f68c3dcbbb 100644 --- a/teuthology/task/kernel.py +++ b/teuthology/task/kernel.py @@ -596,10 +596,18 @@ def install_and_reboot(ctx, config): 'rm', remote_pkg_path(role_remote), run.Raw('&&'), + # work around a systemd issue, where network gets shut down + # before ssh can close its session + run.Raw('('), + 'sleep', + '1', + run.Raw('&&'), 'sudo', 'shutdown', '-r', 'now', + run.Raw('&'), + run.Raw(')'), ], wait=False, ) -- 2.39.5