linux 冻结进程_从Linux崩溃或冻结的X服务器恢复的4种方法

linux 冻结进程

linux 冻结进程

frozen tux

The X server on Linux provides your graphical desktop. If it crashes, you’ll lose all unsaved work in graphical programs, but you can recover from the crash and restart the X server without restarting your computer.

Linux上的X服务器提供了图形桌面。 如果崩溃,您将丢失图形程序中所有未保存的工作,但是您可以从崩溃中恢复并重新启动X服务器,而无需重新启动计算机。

X server crashes can be caused by bugs with graphics drivers – the proprietary AMD or NVIDIA graphics drivers, for example – hardware problems, or other software bugs.

X服务器崩溃可能是由于图形驱动程序的错误(例如,专有的AMD或NVIDIA图形驱动程序)的硬件问题或其他软件错误引起的。

Image Credit: Francois Schnell on Flickr

图片信用: Flickr上的Francois Schnell

Ctrl + Alt + Backspace (Ctrl+Alt+Backspace)

The Ctrl+Alt+Backspace keyboard shortcut traditionally restarted the X server on Linux. However, after complaints – particularly from new Linux users that accidentally hit this key combination and lost all their work — this shortcut was disabled by default. To enable it on Ubuntu, Fedora, or any other distribution using a GNOME-based desktop, you can use the Keyboard Layout utility.

Ctrl + Alt + Backspace键盘快捷键通常在Linux上重新启动X服务器。 但是,在收到投诉(尤其是新Linux用户无意中按下此组合键并丢失了所有工作)后,默认情况下禁用了此快捷方式。 要使用基于GNOME的桌面在Ubuntu,Fedora或任何其他发行版上启用它,可以使用Keyboard Layout实用程序。

image

Click the Options button and enable the Control + Alt + Backspace check box under Key sequence to kill the X server.

单击选项按钮,然后启用键序列下的Control + Alt + Backspace复选框以杀死X服务器。

image

After it’s enabled, you can press Ctrl+Alt+Backspace to immediately restart your X server. However, this shortcut is implemented by the X server and may not work if X hangs in some ways.

启用后,您可以按Ctrl + Alt + Backspace来立即重新启动X服务器。 但是,此快捷方式由X服务器实现,并且如果X以某种方式挂起,则可能无法使用。

切换虚拟控制台 (Switch Virtual Consoles)

You can use the Ctrl+Alt+F1 keyboard shortcut (and other F-key keyboard shortcuts) to switch to a different virtual console from your X server. (Ctrl+Alt+F7 usually takes you back to X – the exact F key depends on your Linux distribution.)

您可以使用Ctrl + Alt + F1键盘快捷键(以及其他F键键盘快捷键 )从X服务器切换到其他虚拟控制台。 (Ctrl + Alt + F7通常将您带回X –确切的F键取决于您Linux发行版。)

Once you have, you can log into the virtual console and run the appropriate command to restart your X server. The command you’ll need depends on the display manager you’re using. On Ubuntu, which uses the LightDM display manager, you’d use the following command:

拥有之后,您可以登录虚拟控制台并运行相应的命令以重新启动X服务器。 您需要的命令取决于您使用的显示管理器。 在使用LightDM显示管理器的Ubuntu上,您将使用以下命令:

sudo service lightdm restart

sudo服务lightdm重新启动

image

SSH进入计算机 (SSH Into Computer)

If you can’t kill the X server locally, you can kill it over the network. Assuming you have an SSH server set up and running on your Linux system, you can log in from another computer and run the appropriate command to restart the X server. Just sign in via SSH to access a remote console and use the appropriate command to restart your display manager – on Ubuntu, it’s the sudo service lightdm restart command above.

如果无法在本地终止X服务器,则可以通过网络终止它。 假设您已在Linux系统上设置并运行了SSH服务器 ,则可以从另一台计算机登录并运行适当的命令以重新启动X服务器。 只需通过SSH登录即可访问远程控制台,并使用适当的命令重新启动显示管理器–在Ubuntu上,这是上面的sudo service lightdm restart命令。

image

使用Magic SysRq键 (Use the Magic SysRq Key)

We’ve covered using the magic SysRq key in the past – the SysRq is is generally the same as the Print Screen key. Assuming you want to kill the X server locally – not over the network – your system may not be responding to key presses, including the Ctrl+Alt+F1 keyboard shortcut. This can occur because the X server has taken control of the keyboard. To take control away from the X server, use the following key combination:

过去,我们已经使用了神奇的SysRq键 -SysRq通常与Print Screen键相同。 假设您想在本地(而不是通过网络)杀死X服务器,您的系统可能没有响应按键,包括Ctrl + Alt + F1键盘快捷键。 发生这种情况是因为X服务器已经控制了键盘。 要控制X服务器,请使用以下组合键:

Alt+SysRq+r

Alt + SysRq + r

After you have, you can try pressing Ctrl+Alt+F1 to access a virtual console. You can also use the Alt+SysRq+k combination, which kills all programs on your current virtual console, including your X server.

完成后,您可以尝试按Ctrl + Alt + F1来访问虚拟控制台。 您还可以使用Alt + SysRq + k组合,这将杀死当前虚拟控制台上的所有程序,包括X服务器。

If you want to restart your computer, you can also use the magic SysRq key to cleanly restart your system – see our full post on the magic SysRq key for more information.

如果您想重新启动计算机,还可以使用魔术SysRq密钥来干净地重新启动系统-有关更多信息,请参阅魔术SysRq密钥上的完整文章

翻译自: https://www.howtogeek.com/119293/4-ways-to-recover-from-a-crashed-or-frozen-x-server-on-linux/

linux 冻结进程

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值