我在 GNOME 终端中运行了一个程序,但屏幕保护程序出现故障,不允许我使用密码返回。在等待修复gnome-screensaver bug,是否有某种方法可以在虚拟控制台 (Ctrl-Alt-F1) 中查看输出(甚至接管进程),而无法与 GNOME 终端交互?
澄清:最初的问题是屏幕保护程序,但我想回答的问题是如何在启动进程后查看在另一个终端中运行的进程的输出而不记录到文件。我猜应该可以从不同的外壳设置进程的输出设备?或者是否可以将另一个 shell 中的进程置于后台模式,并将其置于当前 shell 中的前台?或者甚至要求 GNOME 终端重定向或复制输出?
I've got a program running in a GNOME Terminal, but the screensaver is acting up and won't let me back in with my password. While waiting for a fix for the gnome-screensaver bug, is there some way to see the output (or even take over the process) in a virtual console (Ctrl-Alt-F1) without being able to interact with the GNOME Terminal?
Clarification: The original issue was the screensaver, but the question I'd like answered is how to see the output from a process running in another terminal, after starting the process without any logging to file. I'm guessing it should be possible to set the output device of a process from a different shell? Or is it possible to put a process in another shell into background mode, and get it into the foreground in the current shell? Or even ask GNOME Terminal to redirect or copy the output?
发布评论
评论(5)
我过去很幸运地从虚拟控制台杀死了屏幕保护程序,解锁了 X 会话。
编辑:似乎已经考虑到了这一点,您应该使用这些命令之一,具体取决于您使用的屏幕保护程序:
请参阅这些命令的手册页以获取更多详细信息。
I've had luck in the past killing the screensaver from a virtual console, unlocking X session.
EDIT: Seems like this has been thought of, and you should use one of these commands, depending on which screensaver program you use:
See the man page for those commands for more details.
通常的方法是将输出通过管道传输到文件,例如
program >程序.log
在 Gnome 控制台的另一个选项卡中执行
tail -f program.log
,在非 X 控制台中执行相同的操作。或者,使用
tee
在同一控制台中复制输出:program | tee 程序.log
Usual way is to pipe the output to a file, like
program > program.log
Do
tail -f program.log
in another tab of Gnome console, and the same in the non-X console.Alternatively, use
tee
to duplicate the output in the same console:program | tee program.log
ssh 进入盒子。杀死屏幕保护程序。 su 成为 root 并杀死 -9(如果它确实出现问题)。
ssh in to the box. kill the screensaver. su to become root and kill -9 if it's really acting up.
通常,Gnome 终端会显示 /dev 中的一个 vty 的输出。因此,只需将您的控制台连接到该 vty 即可。
Usually Gnome-Terminal displays the output of one vty out of /dev. So just connect your console to that vty.
使用
screen
启动程序。打开另一个终端,启动
screen -x
,然后您就有了两个终端,它们的作用就像一个终端一样。尝试一下,很有趣:)Launch program with
screen
.Open another terminal, launch
screen -x
and you have two terminals acting like one. Try it, it's fun :)