fix(drive-health): preserve collector boot trigger (#124)

This commit is contained in:
Gustavo Rosa
2026-07-27 23:03:37 -04:00
committed by GitHub
parent be1dd77a0d
commit a3ff0954bd
4 changed files with 8 additions and 2 deletions
@@ -18,7 +18,9 @@ dropin_path="$dropin_dir/interval.conf"
temporary=$(mktemp)
trap 'rm -f -- "$temporary"' EXIT
printf '[Timer]\nOnUnitActiveSec=\nOnUnitActiveSec=%smin\n' "$interval_minutes" >"$temporary"
# Resetting a monotonic timer also removes OnBootSec inherited from the base
# unit, so the drop-in must restore both triggers.
printf '[Timer]\nOnUnitActiveSec=\nOnBootSec=20s\nOnUnitActiveSec=%smin\n' "$interval_minutes" >"$temporary"
install -d -m0755 "$dropin_dir"
install -m0644 "$temporary" "$dropin_path"
@@ -15,6 +15,7 @@ rm -f \
"/etc/systemd/system/$service_name.service" \
"/etc/systemd/system/$service_name.timer"
rm -rf \
"/etc/systemd/system/$service_name.timer.d" \
"/usr/local/libexec/$service_name" \
"/run/$service_name"
+1 -1
View File
@@ -1,6 +1,6 @@
id = "gustav0ar/drive-health"
name = "Drive Health"
version = "1.2.3"
version = "1.2.4"
plugin_api = 9
author = "Drive Health contributors"
license = "MIT"
+3
View File
@@ -20,8 +20,11 @@ grep -q '^OnUnitActiveSec=15min$' "$fixture/noctalia-drive-health.timer"
bash -n "$interval_script"
bash -n "$manage_script"
grep -Fq "OnUnitActiveSec=\\nOnBootSec=20s\\nOnUnitActiveSec=%smin" "$interval_script"
grep -q 'packaging/manage-collector.sh' "$project_dir/packaging/install-system-collector.sh"
grep -q 'packaging/uninstall-system-collector.sh' "$project_dir/packaging/install-system-collector.sh"
grep -Fq '"/etc/systemd/system/$service_name.timer.d"' \
"$project_dir/packaging/uninstall-system-collector.sh"
if grep -R -q 'noctalia-smart-monito[r]' "$project_dir"; then
echo "generic legacy collector namespace must not be read, modified, or removed" >&2