0

Even after configuring storage=persistent in journald.conf configuration file under /etc/systemd, journal directory (log) is getting created/stored under /run/log/journal instead of /var/log/journal. Please let me know what are other configurations that have to be taken care of. Thanks.

4

1 回答 1

0

我想当 systemd-journald 启动时,它会尝试创建 /var/log/journal。它会因为以下原因而失败: - 在 rfs 中,/var/log 是一个指向 /var/volatile/log 的符号链接 - /var/volatile 在启动期间将被挂载为 tmpfs(内存设备) - 挂载后,/ var/volatile/log 和其他几个目录也在启动期间创建,/var/volatile/log 存在,因此符号链接 /var/log 显示为实际目录 - 现在的问题是 systemd-journald 已启动在设置易失性文件系统之前 - 上述步骤在 systemd-journald 启动时不会完成 - 结果,/var/log 看起来不像目录,而是像一个没有指向任何内容的符号链接 - 因此, systemd 无法创建目录 /var/log/journald,因此不会将日志持久存储在那里。好的,要实现这一点,您必须删除符号链接 /var/log 并在 rfs 中创建目录 /var/log。现在,数据应该永久存储在这个目录中,或者存储在 sd 卡上,或者存储在 nfs 文件夹中,具体取决于您启动平台的方式。

于 2013-05-23T06:31:52.870 回答