From 21ad5e757011afb0fc5f54a24cea88a0e9cadc55 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Fri, 3 Feb 2017 11:21:02 +0100 Subject: [PATCH] nuke: work around a reboot -n trouble Signed-off-by: Ilya Dryomov --- teuthology/nuke/actions.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/teuthology/nuke/actions.py b/teuthology/nuke/actions.py index c3eee973bb..56a0866666 100644 --- a/teuthology/nuke/actions.py +++ b/teuthology/nuke/actions.py @@ -152,9 +152,16 @@ def reboot(ctx, remotes): if stale_kernel_mount(remote): log.warn('Stale kernel mount on %s!', remote.name) log.info('force/no-sync rebooting %s', remote.name) - args = ['sync', run.Raw('&'), - 'sleep', '5', run.Raw(';'), - 'sudo', 'reboot', '-f', '-n'] + # -n is ignored in systemd versions through v229, which means this + # only works on trusty -- on 7.3 (v219) and xenial (v229) reboot -n + # still calls sync(). + # args = ['sync', run.Raw('&'), + # 'sleep', '5', run.Raw(';'), + # 'sudo', 'reboot', '-f', '-n'] + args = ['for', 'sysrq', 'in', 's', 'u', 'b', run.Raw(';'), + 'do', 'echo', run.Raw('$sysrq'), run.Raw('|'), + 'sudo', 'tee', '/proc/sysrq-trigger', run.Raw(';'), + 'done'] else: log.info('rebooting %s', remote.name) args = ['sudo', 'reboot'] -- 2.39.5