AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[journalctl](server)

Martin Hope
Konstantin
Asked: 2024-04-05 20:15:55 +0800 CST

为什么 debian 中的自动完成 Journalctl 不起作用?

  • 5

我在 CentOS 中输入命令:

sudo journalctl -xe --unit ss

之后,我按下 Tab 并在控制台中看到:

sudo journalctl -xe --unit sshd.service

我在 Debian 中输入命令:

sudo journalctl -xe --unit ss

之后,我按下 Tab 键......什么也没有发生:

sudo journalctl -xe --unit ss

为什么自动完成 Journalctl 在 Debian 中不起作用?

journalctl
  • 1 个回答
  • 132 Views
Martin Hope
ilya1725
Asked: 2021-10-03 12:11:11 +0800 CST

systemd 日志中的奇怪消息

  • 0

我正在运行systemd版本:

systemd 245 (245.4-4ubuntu3.2)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid

上5.8.0-54-lowlatency #61~20.04.3

出于某种原因,我的服务开始使用以下消息向系统日志发送垃圾邮件:

Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: /
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: <not found>
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: :
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: -1
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: /
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: <not found>
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: :
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: [
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: 1633203968
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: .
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: 541764999
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: ]
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: ERROR
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: :
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]:  ModuleID=7
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]:  Errcode=1009
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]:  X=0
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]:  E=1
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]:  T=1
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: <not found>
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: /
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: <not found>
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: :
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: -1
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: /
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: <not found>
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: :
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: [
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: 1633203968
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: .
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: 551844999
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: ]
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: ERROR
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: :
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]:  ModuleID=8
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]:  Errcode=8
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]:  X=0
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]:  E=1
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]:  T=1
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: <not found>
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: /
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: <not found>
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: :
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: -1
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: /
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: <not found>
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: :
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: [
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: 1633203968
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: .
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: 551904999
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: ]
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: ERROR
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com pitch_bridge[34682]: :

它看起来不像我的应用程序会写的消息。它似乎与系统更相关。任何想法都会有所帮助。到目前为止,有足够的磁盘空间。

linux systemd journalctl
  • 1 个回答
  • 43 Views
Martin Hope
tidelake
Asked: 2021-06-27 01:21:55 +0800 CST

跟踪 journalctl 登录失败以重新启动 systemd 服务?

  • 0

我想知道是否有一种简短的方法可以检查有关在重新启动时引发错误的服务的最后 50 行。

$ sudo 服务 nginx 重启
nginx.service 的作业失败,因为控制进程以错误代码退出。 有关详细信息,请参阅“systemctl status nginx.service”和“journalctl -xe”。

我使用别名进行检查,但我忘记了标志的作用。

别名 jrn='sudo journalctl -eu'

$ jrn nginx 

-- 重启 -- Jun 26 02:52:42 xi systemd[1]: 启动 NGINX Plus - 高性能 Web 服务器... 6 月 26 日 02:52:42 xi systemd[1]:启动 NGINX Plus - 高性能 Web 服务器。 Jun 26 04:03:16 xi systemd[1]: 停止 NGINX Plus - 高性能 Web 服务器... Jun 26 04:03:16 xi systemd[1]: nginx.service: 成功。 6 月 26 日 04:03:16 xi systemd[1]:停止 NGINX Plus - 高性能 Web 服务器。 Jun 26 04:03:16 xi systemd[1]: 启动 NGINX Plus - 高性能 Web 服务器... Jun 26 04:03:16 xi nginx[41832]: nginx: [emerg] bind() to 0.0.0.0:3000 failed (98: Address already in use) Jun 26 04:03:17 xi nginx[41832]: nginx: [emerg] bind() to 0.0.0.0:3000 failed (98: Address already in use) Jun 26 04:03:17 xi nginx[41832]: nginx: [emerg] bind() to 0.0.0.0:3000 failed (98: Address already in use) Jun 26 04:03:18 xi nginx[41832]: nginx: [emerg] bind() to 0.0.0.0:3000 failed (98: Address already in use) Jun 26 04:03:18 xi nginx[41832]: nginx: [emerg] bind() to 0.0.0.0:3000 failed (98: Address already in use) 6 月 26 日 04:03:19 xi nginx [41832]:nginx:[emerg] 仍然无法绑定() Jun 26 04:03:19 xi systemd[1]:nginx.service:控制进程退出,code=exited,status=1/FAILURE Jun 26 04:03:19 xi systemd[1]:nginx.service:失败,结果'退出代码'。 6 月 26 日 04:03:19 xi systemd[1]:无法启动 NGINX Plus - 高性能 Web 服务器。
systemd journalctl systemd-service
  • 1 个回答
  • 1391 Views
Martin Hope
ZoFreX
Asked: 2021-03-26 02:39:42 +0800 CST

journalctl 在 DigitalOcean droplet 上启动后随机停止工作

  • 0

我正在使用我在 DigitalOcean 上使用 Packer 制作的自定义图像构建服务器,并且我遇到了一个反复出现的问题,即 journalctl 没有任何日志:

# journalctl
No journal files were found.

有时我对我构建的图像有这个问题,有时我没有。有时,由同一映像构建的一台服务器可以工作,而另一台则不能。

我还注意到,如果我非常快速地登录到服务器,有时 journalctl 最初可以工作,但很快就会中断(<1 分钟后)。

如果我重新启动 journald,那么从那时起它会正常工作,但我会丢失在那之前的所有日志。

digital-ocean packer journalctl
  • 1 个回答
  • 216 Views
Martin Hope
myNewAccount
Asked: 2020-05-23 16:56:39 +0800 CST

如何在使用 journalctl -f & 启动实时日志记录后终止它

  • 0

环境: CentOS 8

我用命令打开了实时日志,

$ journalctl -f &

我得到了我需要的信息,但不幸的是我不知道如何阻止它。 [CTRL] -c不会阻止它。

是否有一个简单的命令来终止实时日志记录?

linux bash background-process journalctl
  • 1 个回答
  • 451 Views
Martin Hope
ComputerLocus
Asked: 2020-05-07 13:57:15 +0800 CST

Ubuntu 20.04 容器无法在 Proxmox 中启动

  • 0

您好,我在 Proxmox 中创建了一个 Ubuntu 20.04 和 18.04 容器,当我通过 Proxmox GUI 创建容器后尝试启动它们时,它们都返回相同的错误。

它们无法启动并返回以下错误消息:

Job for [email protected] failed because the control process exited with error code.
See "systemctl status [email protected]" and "journalctl -xe" for details.
TASK ERROR: command 'systemctl start pve-container@100' failed: exit code 1

我发现另一个听起来相似的 serverfault 问题] 1,但是错误略有不同,我什至还没有到能够设置任何东西的步骤。这些是直接通过 Proxmox 的官方位置下载的干净的 Ubuntu 模板。此外,当我设置 Proxmox I 和容器时,我将所有内容都保留为默认值,包括所有存储内容。

我有点不清楚从这里去哪里或做什么。

我还按照错误消息指示的详细信息执行了journalctl -xe命令和systemctl status命令,结果如下:

# journalctl -xe
-- Support: https://www.debian.org/support
-- 
-- An ExecStart= process belonging to unit [email protected] has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 1.
May 06 17:53:56 ns500282 systemd[1]: [email protected]: Killing process 14587 (lxc-start) with signal SIGKILL.
May 06 17:53:56 ns500282 systemd[1]: [email protected]: Killing process 14648 (apparmor_parser) with signal SIGKILL.
May 06 17:53:56 ns500282 systemd[1]: [email protected]: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- The unit [email protected] has entered the 'failed' state with result 'exit-code'.
May 06 17:53:56 ns500282 systemd[1]: Failed to start PVE LXC Container: 100.
-- Subject: A start job for unit [email protected] has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- A start job for unit [email protected] has finished with a failure.
-- 
-- The job identifier is 173480 and the job result is failed.
May 06 17:54:00 ns500282 systemd[1]: Starting Proxmox VE replication runner...
-- Subject: A start job for unit pvesr.service has begun execution
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- A start job for unit pvesr.service has begun execution.
-- 
-- The job identifier is 173490.
May 06 17:54:00 ns500282 systemd[1]: pvesr.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- The unit pvesr.service has successfully entered the 'dead' state.
May 06 17:54:00 ns500282 systemd[1]: Started Proxmox VE replication runner.
-- Subject: A start job for unit pvesr.service has finished successfully
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- A start job for unit pvesr.service has finished successfully.
-- 
-- The job identifier is 173490.

和

# systemctl status [email protected]
● [email protected] - PVE LXC Container: 100
   Loaded: loaded (/lib/systemd/system/[email protected]; static; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2020-05-06 17:53:56 EDT; 2min 19s ago
     Docs: man:lxc-start
           man:lxc
           man:pct
  Process: 14579 ExecStart=/usr/bin/lxc-start -n 100 (code=exited, status=1/FAILURE)

May 06 17:53:54 ns500282 systemd[1]: Starting PVE LXC Container: 100...
May 06 17:53:56 ns500282 lxc-start[14579]: lxc-start: 100: lxccontainer.c: wait_on_daemonized_start: 874 Received container state "ABORTING" instead of "RUNNING"
May 06 17:53:56 ns500282 lxc-start[14579]: lxc-start: 100: tools/lxc_start.c: main: 329 The container failed to start
May 06 17:53:56 ns500282 lxc-start[14579]: lxc-start: 100: tools/lxc_start.c: main: 332 To get more details, run the container in foreground mode
May 06 17:53:56 ns500282 lxc-start[14579]: lxc-start: 100: tools/lxc_start.c: main: 335 Additional information can be obtained by setting the --logfile and --logpriority 
May 06 17:53:56 ns500282 systemd[1]: [email protected]: Control process exited, code=exited, status=1/FAILURE
May 06 17:53:56 ns500282 systemd[1]: [email protected]: Killing process 14587 (lxc-start) with signal SIGKILL.
May 06 17:53:56 ns500282 systemd[1]: [email protected]: Killing process 14648 (apparmor_parser) with signal SIGKILL.
May 06 17:53:56 ns500282 systemd[1]: [email protected]: Failed with result 'exit-code'.
May 06 17:53:56 ns500282 systemd[1]: Failed to start PVE LXC Container: 100.
ubuntu ubuntu-20.04 proxmox journalctl
  • 1 个回答
  • 1621 Views
Martin Hope
ChromeHearts
Asked: 2016-10-01 18:58:13 +0800 CST

如何允许用户使用 journalctl 查看用户特定的 systemd 服务日志?

  • 39

我在 Ubuntu 16.04 LTS 中运行用户级服务。例如,我的 test.service 位于~/.config/systemd/user/test.service.

我能够通过这样做来运行服务

systemctl --user start test.target

但是,当我尝试使用 读取它的日志时journalctl,我收到了以下错误消息:

journalctl --user -u test.service
Hint: You are currently not seeing messages from other users and the system.
  Users in the 'systemd-journal' group can see all messages. Pass -q to
  turn off this notice.
No journal files were opened due to insufficient permissions.

我如何使用journalctl用户的特定单位?

permissions systemd systemctl ubuntu-16.04 journalctl
  • 2 个回答
  • 35247 Views
Martin Hope
lyoko the
Asked: 2016-08-30 12:01:43 +0800 CST

systemd-journald 根本不启动

  • 7

意外删除我/var/log/journal的后,我无法从后果中恢复过来。systemd-journald每次我尝试启动它时都会一遍又一遍地失败。当我运行时:

$ journalctl --verify
PASS: /run/log/journal/system.journal

这并没有让我更接近解决它,因为它/run/log/journal/system.journal是在我/usr/lib/systemd/systemd-journald直接运行时创建的,它会自行输出

$ /usr/lib/systemd/systemd-journald
Failed to open runtime journal: Invalid argument

我已经尝试过的事情:

  1. 清理/var/log/journal and/run/log/journal`。
  2. 从另一台机器复制/var/log/journal到两条路径,运行journalctl --verify以检查它们,然后再次使用--file标志。
  3. 将 Storage 设置更改/etc/systemd/journald.conf为Storage=volatile仅禁用/var/log/journald.
  4. 重新启动。
systemd journalctl journald
  • 3 个回答
  • 11946 Views
Martin Hope
resi
Asked: 2016-04-20 03:04:31 +0800 CST

结合本地和远程日志日志

  • 2

我在 centos7 上使用systemd-journal-remote(本地站点)和systemd-journal-upload(远程站点)在两台机器上使用 systemd-219 使用日志转发。

本地日志存储在,/var/log/journal/<machine_id>/*.journal而远程上传存储在/var/log/journal/remote/remote-*.journal.

我可以使用journalctl -lfor单独查看两者journalctl -D /var/log/journal/remote -lf。

我现在正在尝试使用 获得组合视图journalctl -m,其中手册页说它将显示来自所有可用期刊的条目,包括远程期刊,但这似乎不起作用,至少不是我期望的方式,因为期刊不会以任何方式合并。

UsingSYSTEMD_LOG_LEVEL=debug journalctl -lfm给出了关于包含的日志文件的提示:

Root directory /var/log/journal added.
Considering /var/log/journal/fb643c7c40aa414aab4fe052ee7aff57.
Directory /var/log/journal/fb643c7c40aa414aab4fe052ee7aff57 added.
File /var/log/journal/fb643c7c40aa414aab4fe052ee7aff57/system.journal added.
File /var/log/journal/fb643c7c40aa414aab4fe052ee7aff57/user-1001.journal added.
File /var/log/journal/fb643c7c40aa414aab4fe052ee7aff57/user-1000.journal added.
Journal filter: none
Considering /var/log/journal/fb643c7c40aa414aab4fe052ee7aff57.
... journal output ...

有没有办法实现所有期刊的合并视图,我的意思是所有期刊文件位于某处/var/log/journal/?

linux systemd journalctl journald
  • 3 个回答
  • 2440 Views
Martin Hope
Jack O'Connor
Asked: 2016-04-08 12:48:40 +0800 CST

有没有办法让 journalctl 显示“上次 foo.service 运行”的日志?

  • 28

我对查看在计时器上运行的 oneshot 服务的输出特别感兴趣。该--unit标志是关闭的,但它将服务的所有运行连接在一起。我能想到的最明显的方法是过滤 PID,但这让我担心 PID 重用/分叉的服务,并且获取最后一个 PID 非常不方便。是否有一些其他标识符对应于服务的单次运行,我可以用来过滤日志?

编辑:如果这是真正的答案,我很乐意接受权威的“不”。

journalctl
  • 6 个回答
  • 24655 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve