From: Sage Weil Date: Tue, 1 Oct 2013 16:57:34 +0000 (-0700) Subject: nuke: make half-hearted attempt to sync before reboot X-Git-Tag: 1.1.0~1845^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3e31c493449f2dec50cd562e9e60c366bc398fd6;p=teuthology.git nuke: make half-hearted attempt to sync before reboot We don't want to block on sync for fear of a hung kernel mount. However, we can give it a try and wait a few seconds to get what we can. This fixes a problem where our recent modifications to the sudoers file are lost, with a 0 byte file left in its place, because the task fails and we do a reboot -f -n. Signed-off-by: Sage Weil --- diff --git a/teuthology/nuke.py b/teuthology/nuke.py index ed9252d9..8dfaee0c 100644 --- a/teuthology/nuke.py +++ b/teuthology/nuke.py @@ -197,12 +197,17 @@ def remove_osd_tmpfs(ctx, log): ) def reboot(ctx, remotes, log): + from .orchestra import run import time nodes = {} for remote in remotes: log.info('rebooting %s', remote.name) proc = remote.run( # note use of -n to force a no-sync reboot - args=['sudo', 'reboot', '-f', '-n'], + args=[ + 'timeout', '5', 'sync', + run.Raw(';'), + 'sudo', 'reboot', '-f', '-n' + ], wait=False ) nodes[remote] = proc