]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
nuke: work around a reboot -n trouble 1024/head
authorIlya Dryomov <idryomov@gmail.com>
Fri, 3 Feb 2017 10:21:02 +0000 (11:21 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Fri, 3 Feb 2017 13:47:44 +0000 (14:47 +0100)
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
teuthology/nuke/actions.py

index c3eee973bb119205e6f57887b02fc113a9d64ed6..56a086666676eb9624550fd1ba65f08490d47191 100644 (file)
@@ -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']