擅长:python、mysql、java
<p>我在使用ansible时发现了一个类似的问题:<a href="https://stackoverflow.com/q/29955605/4905806">link</a></p>
<p>我认为最重要的答案是正确的:</p>
<blockquote>
<p><code>reboot</code> is shutting down the server so quickly that the server is tearing down the SSH connection.</p>
</blockquote>
<p>{cd1>返回相同的错误^:</p>
<blockquote>
<p>sudo() received nonzero return code -1 while executing 'shutdown -r now'!</p>
</blockquote>
<p><code>shutdown -r +1</code>返回成功:</p>
<blockquote>
<p>out: Shutdown scheduled for Mon 2016-05-23 14:16:48 UTC, use 'shutdown -c' to cancel.</p>
</blockquote>
<p>但关闭只能延迟至少一分钟。
所以我们只能选择等待一分钟或忽略错误。在</p>