diff --git a/packages/mediacenter/kodi/scripts/pastekodi b/packages/mediacenter/kodi/scripts/pastekodi index 99d98b5d49..2c8d3f42dd 100755 --- a/packages/mediacenter/kodi/scripts/pastekodi +++ b/packages/mediacenter/kodi/scripts/pastekodi @@ -82,7 +82,7 @@ fi cat_file "${LOG_FILE}" - journalctl -a -o short-precise | cat_data "journalctl -a" + journalctl -a -b -0 -o short-precise | cat_data "journalctl -a -b -0" if [ "${LIBREELEC_PROJECT}" = "RPi" ]; then vcgencmd bootloader_version | cat_data "Bootloader version" diff --git a/packages/sysutils/busybox/system.d/storage-log.service b/packages/sysutils/busybox/system.d/storage-log.service index d27d0a31df..deb6f6a1c2 100644 --- a/packages/sysutils/busybox/system.d/storage-log.service +++ b/packages/sysutils/busybox/system.d/storage-log.service @@ -1,9 +1,10 @@ [Unit] -Description=Create Persistent Log Directory on /storage +Description=Create Persistent Log Directory on /storage and rotate large logs DefaultDependencies=no RequiresMountsFor=/storage [Service] Type=oneshot RemainAfterExit=yes -ExecStart=/bin/mkdir -p /storage/.cache/log/journal +ExecStart=/bin/mkdir -p /storage/.cache/log/journal /storage/.cache/journald.conf.d ; \ +/usr/bin/find /storage/.cache/log/ -maxdepth 1 -type f -size +512k ! -name '*.old' -exec mv {} {}.old \; diff --git a/packages/sysutils/busybox/system.d/var-log.mount b/packages/sysutils/busybox/system.d/var-log.mount index e6b6ebf88b..26f34cb1d1 100644 --- a/packages/sysutils/busybox/system.d/var-log.mount +++ b/packages/sysutils/busybox/system.d/var-log.mount @@ -6,6 +6,7 @@ After=storage-log.service ConditionKernelCommandLine=!installer ConditionKernelCommandLine=|debugging ConditionPathExists=|/storage/.cache/debug.libreelec +ConditionPathExists=|/storage/.cache/journald.conf.d/00_settings.conf [Mount] What=/storage/.cache/log diff --git a/packages/sysutils/systemd/package.mk b/packages/sysutils/systemd/package.mk index f6368b4423..f3243303ec 100644 --- a/packages/sysutils/systemd/package.mk +++ b/packages/sysutils/systemd/package.mk @@ -250,6 +250,9 @@ post_makeinstall_target() { ln -sf /storage/.config/hwdb.d ${INSTALL}/etc/udev/hwdb.d safe_remove ${INSTALL}/etc/udev/rules.d ln -sf /storage/.config/udev.rules.d ${INSTALL}/etc/udev/rules.d + + # journald + ln -sf /storage/.cache/journald.conf.d ${INSTALL}/usr/lib/systemd/journald.conf.d } post_install() {