Lots of reorganization. Added stormux package repository. Removed unneeded packages. Switched to systemd management of logging to ram. Use existing tools to resize the image to fill the device, no more growpartfs. No packages installed from AUR any more.
This commit is contained in:
16
pi4/files/etc/systemd/system/log-to-ram-setup.service
Normal file
16
pi4/files/etc/systemd/system/log-to-ram-setup.service
Normal file
@@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Setup RAM logging and restore logs from disk
|
||||
DefaultDependencies=false
|
||||
After=local-fs.target
|
||||
Before=sysinit.target
|
||||
RequiresMountsFor=/var
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStartPre=/bin/mkdir -p /var/log.hdd
|
||||
ExecStartPre=/bin/sh -c 'if [ -d /var/log.hdd ] && [ "$(ls -A /var/log.hdd 2>/dev/null)" ]; then cp -au /var/log.hdd/* /var/log/ 2>/dev/null || true; fi'
|
||||
ExecStart=/bin/true
|
||||
|
||||
[Install]
|
||||
WantedBy=sysinit.target
|
14
pi4/files/etc/systemd/system/log-to-ram-shutdown.service
Normal file
14
pi4/files/etc/systemd/system/log-to-ram-shutdown.service
Normal file
@@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=Sync logs to disk before shutdown
|
||||
DefaultDependencies=false
|
||||
Before=shutdown.target reboot.target halt.target
|
||||
Conflicts=shutdown.target reboot.target halt.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=true
|
||||
ExecStart=/bin/sh -c 'rsync -aXv --delete --exclude="*.hdd" /var/log/ /var/log.hdd/ 2>/dev/null || true'
|
||||
TimeoutStopSec=30
|
||||
|
||||
[Install]
|
||||
WantedBy=shutdown.target reboot.target halt.target
|
8
pi4/files/etc/systemd/system/log-to-ram-sync.service
Normal file
8
pi4/files/etc/systemd/system/log-to-ram-sync.service
Normal file
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=Sync logs from RAM to disk
|
||||
After=local-fs.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStartPre=/bin/mkdir -p /var/log.hdd
|
||||
ExecStart=/bin/sh -c 'rsync -aXv --delete --exclude="*.hdd" /var/log/ /var/log.hdd/ 2>/dev/null || true'
|
11
pi4/files/etc/systemd/system/log-to-ram-sync.timer
Normal file
11
pi4/files/etc/systemd/system/log-to-ram-sync.timer
Normal file
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Sync logs from RAM to disk every hour
|
||||
Requires=log-to-ram-sync.service
|
||||
|
||||
[Timer]
|
||||
OnBootSec=15min
|
||||
OnUnitActiveSec=1h
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
Reference in New Issue
Block a user