]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
kernel: fix reboot into the new kernel on xenial 992/head
authorIlya Dryomov <idryomov@gmail.com>
Thu, 1 Dec 2016 15:36:42 +0000 (16:36 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Fri, 2 Dec 2016 15:26:04 +0000 (16:26 +0100)
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 <idryomov@gmail.com>
teuthology/task/kernel.py

index 9bfc775f8417878223376ec383c1749042eb9043..f68c3dcbbbd671be7254670bbc8f91b36868e053 100644 (file)
@@ -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,
             )