nuke: fix sync before reboot timeout

If you do 'timeout 5 sync' and sync hangs, timeout will block trying to
kill it.

Instead, just background sync, wait a few seconds, and reboot.  This means
we wait a few seconds even if sync returns immediately, but who cares!

Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Sage Weil 2013-12-06 17:42:23 -08:00
parent bec1ac191e
commit c0a4327513

View File

@ -150,7 +150,9 @@ def reboot(ctx, remotes):
log.info('rebooting %s', remote.name)
proc = remote.run( # note use of -n to force a no-sync reboot
args=[
'timeout', '5', 'sync',
'sync',
run.Raw('&'),
'sleep', '5',
run.Raw(';'),
'sudo', 'reboot', '-f', '-n'
],