This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
正如 jørgensen 所指出的,您可以使用 SYSRQ (http://en.wikipedia.org/wiki/Magic_SysRq_key< /a>),直接与内核对话的 API。
请注意,这些都是非常硬核的,可能会损害您的硬件。重启需要花费单个 UDP 数据包传输的时间。繁荣。我们只在实时无盘计算机上使用它。
1. xt_SYSRQ(iptables模块,内核)
xt_SYSRQ是xtables-addons-common提供的iptables模块之一: http://manpages.ubuntu.com/manpages/oneiric/man8/xtables-addons.8.html
时安装
在 debian Shotgun 重新启动
2. sysrqd(tcp 4094 监听守护进程,用户态
)仅当您的砖机计算机能够处理 TCP 连接时,该解决方案才有效。
上安装
在 debian Shutgun 重新启动
我制作了一个脚本, https://gist.github.com/qolund/1470beaa1a63e034025d 但它只是端口 4094 上的 TCP 连接。
您需要发送密码和命令,
连接未正确关闭,因为“b”重新启动命令太快,计算机已经重新启动。
As pointed out by jørgensen, you can use SYSRQ (http://en.wikipedia.org/wiki/Magic_SysRq_key), an API directly talking to the kernel.
Beware, these are quite hardcore and may harm your hardware. It takes the time of a single UDP packet transfer to reboot. Boom. We only use it on live diskless computers.
1. xt_SYSRQ (iptables modules, kernel)
There is xt_SYSRQ, one of the iptables modules provided by xtables-addons-common : http://manpages.ubuntu.com/manpages/oneiric/man8/xtables-addons.8.html
Installing on debian
Shotgun reboot
2. sysrqd (tcp 4094 listening daemon, userland)
This solution works only if your bricked computer is able to handle TCP connections.
Installing on debian
Shutgun reboot
I made a script, https://gist.github.com/qolund/1470beaa1a63e034025d but its just a TCP connexion on port 4094.
You need to send the password and the commands,
The connection isn't properly closed, because the 'b' reboot command is too fast, the computer is already rebooting.
几个选项:
这个工具并不完全是用来关闭机器的(但他们可以做到),它们是配置管理框架来管理很多机器,它们可以处理配置更改、软件包安装和更新,并在一台机器、一组机器或整个网络中运行您想要的所有命令。
A few options:
This tools are not exactly to shutdown machines (but they can do it), they are configuration management frameworks to administer a lots of machines, they can handle configuration changes, package installs and updates, and run all the commands you want, in one machine, in a set of machines, or in the whole network.