[Unit]
Description=Debug /var/log relink
DefaultDependencies=false
After=var.mount
Before=systemd-journal-flush.service
ConditionKernelCommandLine=!installer
ConditionKernelCommandLine=|debugging
ConditionPathExists=|/storage/.cache/debug.libreelec

[Service]
Type=oneshot
ExecStartPre=/bin/rm -rf /var/log
ExecStartPre=-/bin/mkdir -p /storage/log/journal
ExecStart=-/bin/ln -sf /storage/log /var/log
RemainAfterExit=yes

[Install]
WantedBy=sysinit.target
