Force a remote host to reboot via VNC

Yesterday, dealt with a machine in a pretty bad state:

• SSH was Down

• Memory was exhausted (OOM)

• Ctrl + Alt + Del from VNC was not responding

• A background operation on the OpenStack API was preventing any nova reboot --hard zombie-essential-instance.my-infra.net

In such situations, the last resort is Alt+SysRQ+b to force the host into immediate reboot, possible loosing or corrupting data data in the way.

The trick is that, obviously, you can not type this sequence on your laptop as usual, or the machine that will reboot will not be the one you expect… Hence to goal is to feed the relevant keycodes directly to VNC. As VNC has originally been built specifically for X11, the keycodes you need to send are the one X11 itself uses internally. Which are found in the source code.

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论