Compare commits

...

2 Commits

Author SHA1 Message Date
Azlux 18226e084f Rollback tests 2022-01-05 22:33:53 +01:00
Azlux 2c3f86134d Fix flush log, rare race condition
No obvious, should fix the issue
2022-01-05 22:25:07 +01:00
2 changed files with 10 additions and 1 deletions

View File

@ -59,6 +59,12 @@ wait_for () {
while ! findmnt "$1" > /dev/null; do
sleep 0.1
done
while [ ! -f "$1/log2ram.test" ]; do
touch "$1/log2ram.test"
sleep 0.1
done
rm "$1/log2ram.test"
}
createZramLogDrive () {
@ -104,6 +110,7 @@ case "$1" in
wait_for "$RAM_LOG"
syncFromDisk
done
exit 0
;;
stop)
@ -123,6 +130,7 @@ case "$1" in
# Unsure as even with Root permision denied
#echo ${ZRAM_LOG} > /sys/class/zram-control/hot_remove
done
exit 0
;;
write)
@ -136,6 +144,7 @@ case "$1" in
syncToDisk
done
exit 0
;;
*)

View File

@ -1,7 +1,7 @@
[Unit]
Description=Log2Ram
DefaultDependencies=no
Before=basic.target rsyslog.service syslog-ng.service syslog.target systemd-journald.service sysinit.target shutdown.target zram-swap.service apache2.service lighttpd.service
Before=basic.target rsyslog.service syslog-ng.service syslog.target systemd-journald.service sysinit.target shutdown.target zram-swap-conf.service apache2.service lighttpd.service
After=local-fs.target
Conflicts=shutdown.target reboot.target halt.target
RequiresMountsFor=/var/log /var/hdd.log