我有一个小型的cpp应用程序,它将重新启动系统。到目前为止,这是非常有效的。
sync(); //need for data safety
reboot(RB_AUTOBOOT);
除非您通过SSH连接并在连接的设备上运行此程序。然后SSH连接挂起。
如果您通过SSH连接并使用CLI命令
sudo reboot
或
sudo shutdown -r now
SSH连接将使用以下消息终止
Connection to xxx.xxx.xxx.xxx closed by remote host.
Connection to xxx.xxx.xxx.xxx closed.
如何使用cpp重新启动方法获
我有一个小的cpp应用程序,将重新启动系统。到目前为止,这个方法运行得很好。 sync(); //need for data safety
reboot(RB_AUTOBOOT); 除非您通过SSH连接并在连接的设备上运行此程序。然后,SSH连接挂起。 如果您通过SSH连接并使用CLI命令 sudo reboot 或 sudo shutdown -r now SSH连接将终止,并显示以下消息 Connection to xxx.xxx.xxx.xxx closed by remote host.
Connection to xxx.xxx.xxx.xxx closed. 如何使用cpp重启方
在像ssh <destination> true这样的命令中,ssh在目的地上执行命令true,然后终止会话。当运行ssh <destination> exit时,是什么启动了会话的终止?是ssh程序本身和其他命令一样,还是目标执行的是exit命令本身?
SSH手册上写着,The session terminates when the command or shell on the remote machine exits and all X11 and TCP connections have been closed.
我的ShoreTel语音开关出了问题,我试图使用Paramiko跳入其中并运行一些命令。我认为问题可能是,ShoreTel CLI给出的提示与标准的Linux不同。看起来是这样的:
server1$:stcli
Mitel>gotoshell
CLI> (This is where I need to enter 'hapi_debug=1')
Python仍然期望$,还是我遗漏了其他东西?
我认为这可能是时间问题,所以我把这些time.sleep(1)放在命令之间。似乎还是没有服用。
import paramiko
import time
keyfile =
通过远程查看器VNC,我可以在远程计算机上引导android模拟器。
emulator -avd emu1
但是通过远程机器上的SSH,我得到了错误
emulator: INFO: QtLogger.cpp:68: Warning: could not connect to display ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Info: Could not load the Qt platform plugin "xcb" in "/opt/androidtest/android-sdk/emu