결과 시간 초과로 인해 systemd-journal-flush.service가 실패했습니다. 로그를 영구 저장소로 플러시할 수 없습니다.

결과 시간 초과로 인해 systemd-journal-flush.service가 실패했습니다. 로그를 영구 저장소로 플러시할 수 없습니다.

내 systemctl 로그에 이 내용이 표시됩니다. systemd-journal-flush.service가 시간 초과 오류로 인해 시작되지 않습니다. 하지만 서버는 잘 돌아가고 있는 것 같습니다. 운영체제는 CentOS 8입니다. 로그에는 오류가 자세히 설명되어 있지 않습니다. 누구든지 나를 도울 수 있다면 감사하겠습니다.

#sudo systemctl start systemd-journal-flush.service
Job for systemd-journal-flush.service failed because a timeout was exceeded.


#systemctl status systemd-journal-flush.service
● systemd-journal-flush.service - Flush Journal to Persistent Storage
   Loaded: loaded (/usr/lib/systemd/system/systemd-journal-flush.service; static; vendor preset: disabled)
   Active: failed (Result: timeout) since Sat 2023-03-18 04:08:07 GMT; 3min 28s ago
     Docs: man:systemd-journald.service(8)
           man:journald.conf(5)
  Process: 13447 ExecStart=/usr/bin/journalctl --flush (code=killed, signal=TERM)
 Main PID: 13447 (code=killed, signal=TERM)

Mar 18 04:06:37 systemd[1]: Starting Flush Journal to Persistent Storage...
Mar 18 04:08:07 systemd[1]: systemd-journal-flush.service: start operation timed out. Terminating.
Mar 18 04:08:07 systemd[1]: systemd-journal-flush.service: Main process exited, code=killed, status=15/TERM
Mar 18 04:08:07 systemd[1]: systemd-journal-flush.service: Failed with result 'timeout'.
Mar 18 04:08:07 systemd[1]: Failed to start Flush Journal to Persistent Storage.


#journalctl -xe
Mar 18 04:06:37 systemd[1]: Starting Flush Journal to Persistent Storage...
-- Subject: Unit systemd-journal-flush.service has begun start-up
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit systemd-journal-flush.service has begun starting up.
Mar 18 04:06:37 systemd-journald[860]: Runtime journal (/run/log/journal/9b0915b205da456da00e935c8704118b) is 14.3M, max 38.3M, 23.9M free.
-- Subject: Disk space used by the journal
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Runtime journal (/run/log/journal/9b0915b205da456da00e935c8704118b) is currently using 14.3M.
-- Maximum allowed usage is set to 38.3M.
-- Leaving at least 57.5M free (of currently available 368.6M of disk space).
-- Enforced usage limit is thus 38.3M, of which 23.9M are still available.
--
-- The limits controlling how much disk space is used by the journal may
-- be configured with SystemMaxUse=, SystemKeepFree=, SystemMaxFileSize=,
-- RuntimeMaxUse=, RuntimeKeepFree=, RuntimeMaxFileSize= settings in
-- /etc/systemd/journald.conf. See journald.conf(5) for details.
Mar 18 04:06:42 dbus-daemon[1068]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service' requested by ':1.718' (uid=0 pid=10797 comm="cockpit-bridge --privileged " label="unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023")
Mar 18 04:06:42 systemd[1]: Starting System clock and RTC settings service...
-- Subject: Unit timedatex.service has begun start-up
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit timedatex.service has begun starting up.
Mar 18 04:06:42 dbus-daemon[1068]: [system] Successfully activated service 'org.freedesktop.timedate1'
Mar 18 04:06:42 systemd[1]: Started System clock and RTC settings service.
-- Subject: Unit timedatex.service has finished start-up
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit timedatex.service has finished starting up.
--
-- The start-up result is done.
Mar 18 04:08:07 systemd[1]: systemd-journal-flush.service: start operation timed out. Terminating.
Mar 18 04:08:07 systemd[1]: systemd-journal-flush.service: Main process exited, code=killed, status=15/TERM
Mar 18 04:08:07 systemd[1]: systemd-journal-flush.service: Failed with result 'timeout'.

ベストアンサー1

디렉터리가 존재하지 않기 때문에 데몬이 journald새로 고쳐지지 않으며 디렉터리를 생성하라는 메시지도 표시되지 않습니다. 불행하게도 새로 고침이 완료되기를 기다리다가 완료되지 않습니다./var/log/journal/etc/systemd/journald.confjournalctl --flush

나에게 도움이 된 해결책은 다음과 같습니다.

  1. sudoedit /etc/systemd/journald.conf
  2. 이 줄 [Journal]뒤에 줄을 추가합니다 .Storage=persistent
  3. 재시작.

매뉴얼 페이지를 읽으면 기본값과 어떻게 다른지에 대한 설명을 볼 수 있습니다 journald.conf(5).persistentauto

"auto"는 "영구"와 비슷하지만 /var/log/journal 필요한 경우 디렉토리가 생성되지 않으므로 해당 존재가 로그 데이터가 이동하는 위치를 제어합니다.

구성을 변경하고 재부팅하면 journald올바른 권한(분명히 소유자=루트, 그룹=systemd-journal, 모드=02755, ACL은 r-x그룹 adm 및 그룹 휠에 대한 명시적 액세스 권한 부여)을 사용하여 누락된 디렉터리를 생성할 수 있습니다. 물론 다시 시작하지 않고도 직접 만들 수 있습니다.

おすすめ記事