如何在Ubuntu中查看过程日志

发布于 2025-02-05 04:00:41 字数 499 浏览 3 评论 0原文

我在连续运行的GCP Ubuntu验证器上启动了一个验证器。

当我使用验证器启动以下验证器时:

sudo mortar server --data-dir ./data-dir --chain genesis.json  --libp2p 0.0.0.0:PORT --nat IP-ADDRESS --seal --price-limit 1 &

该过程中的所有日志都在我当前的Shell会话中输出。

但是,由于关闭并重新连接到VM,因此我无法访问日志。我尝试了Reptyr 6460,但是获取此错误

Process 6460 (sudo) shares 6461's process group. Unable to attach.
(This most commonly means that 6461 has suprocesses).

是否有其他方法可以实时重新连接到该过程日志?

I started a validator on a GCP Ubuntu validator which runs continuously.

When I started the validator with:

sudo mortar server --data-dir ./data-dir --chain genesis.json  --libp2p 0.0.0.0:PORT --nat IP-ADDRESS --seal --price-limit 1 &

all the logs from the process were outputted in my current shell session.

However since closing and reconnecting to the VM I cannot access the logs. I tried reptyr 6460 but get this error

Process 6460 (sudo) shares 6461's process group. Unable to attach.
(This most commonly means that 6461 has suprocesses).

Is there any other way to reconnect to the processes logs in real time?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

遇到 2025-02-12 04:00:42

正如Bryan L在使用屏幕的评论中建议的那样,屏幕 dick

apt install script

屏幕

现在您可以运行程序。断开和重新连接启动屏幕后,使用:

屏幕-R

As Bryan L suggested in a comment using screen did the screen did the trick

apt install screen

screen

Now you can run your program. After disconnecting and reconnecting start screen using:

screen -r

眼泪都笑了 2025-02-12 04:00:42

Linux日志将使用命令CD/var/log显示。然后,您可以输入LS以查看该目录下存储的日志。查看最重要的日志之一是Syslog,该日志记录了与身份相关的消息以外的所有内容。发出命令var/log/syslog,以查看syslog下的所有内容。

所以:

Open the terminal window on Linux.
For remote Linux server use the ssh command for log in purpose.
Type the ps aux to see all running process in Linux.
Alternatively, you can issue the top command or htop command to view running process in Linux.

Linux logs will display with the command cd/var/log. Then, you can type ls to see the logs stored under this directory. One of the most important logs to view is the syslog, which logs everything but auth-related messages. Issue the command var/log/syslog to view everything under the syslog.

so:

Open the terminal window on Linux.
For remote Linux server use the ssh command for log in purpose.
Type the ps aux to see all running process in Linux.
Alternatively, you can issue the top command or htop command to view running process in Linux.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文