Ensure sysstat timer enabled in installer

This commit is contained in:
root
2026-01-29 23:09:45 +02:00
parent 6ed9a52113
commit 999f49c98e
2 changed files with 30 additions and 12 deletions

View File

@@ -1051,9 +1051,9 @@ configure_sysstat() {
mkdir -p /etc/systemd/system/sysstat-collect.timer.d
cat > /etc/systemd/system/sysstat-collect.timer.d/override.conf <<'EOF'
[Timer]
OnCalendar=
OnUnitActiveSec=1min
AccuracySec=1s
OnCalendar=*:0/1
AccuracySec=30s
Persistent=true
EOF
fi
@@ -1061,10 +1061,19 @@ EOF
chmod 0755 /var/log/sysstat
systemctl daemon-reload 2>/dev/null || true
systemctl enable --now sysstat-collect.timer sysstat-summary.timer sysstat 2>/dev/null || true
systemctl restart sysstat-collect.timer sysstat-summary.timer sysstat 2>/dev/null || true
systemctl enable --now sysstat-collect.timer 2>/dev/null || true
systemctl enable --now sysstat-summary.timer 2>/dev/null || true
if systemctl list-unit-files | grep -q '^sysstat.service'; then
systemctl enable --now sysstat.service 2>/dev/null || true
fi
systemctl restart sysstat-collect.timer 2>/dev/null || true
systemctl restart sysstat-summary.timer 2>/dev/null || true
if [[ -x /usr/lib/sysstat/sadc ]]; then
if [[ -x /usr/libexec/sysstat/sa1 ]]; then
/usr/libexec/sysstat/sa1 1 1 >/dev/null 2>&1 || true
elif [[ -x /usr/lib/sysstat/sa1 ]]; then
/usr/lib/sysstat/sa1 1 1 >/dev/null 2>&1 || true
elif [[ -x /usr/lib/sysstat/sadc ]]; then
/usr/lib/sysstat/sadc 1 1 /var/log/sysstat/sa"$(date +%d)" >/dev/null 2>&1 || true
elif command -v sadc >/dev/null 2>&1; then
sadc 1 1 /var/log/sysstat/sa"$(date +%d)" >/dev/null 2>&1 || true

View File

@@ -1019,9 +1019,9 @@ configure_sysstat() {
mkdir -p /etc/systemd/system/sysstat-collect.timer.d
cat > /etc/systemd/system/sysstat-collect.timer.d/override.conf <<'EOF'
[Timer]
OnCalendar=
OnUnitActiveSec=1min
AccuracySec=1s
OnCalendar=*:0/1
AccuracySec=30s
Persistent=true
EOF
fi
@@ -1029,10 +1029,19 @@ EOF
chmod 0755 /var/log/sysstat
systemctl daemon-reload 2>/dev/null || true
systemctl enable --now sysstat-collect.timer sysstat-summary.timer sysstat 2>/dev/null || true
systemctl restart sysstat-collect.timer sysstat-summary.timer sysstat 2>/dev/null || true
systemctl enable --now sysstat-collect.timer 2>/dev/null || true
systemctl enable --now sysstat-summary.timer 2>/dev/null || true
if systemctl list-unit-files | grep -q '^sysstat.service'; then
systemctl enable --now sysstat.service 2>/dev/null || true
fi
systemctl restart sysstat-collect.timer 2>/dev/null || true
systemctl restart sysstat-summary.timer 2>/dev/null || true
if [[ -x /usr/lib/sysstat/sadc ]]; then
if [[ -x /usr/libexec/sysstat/sa1 ]]; then
/usr/libexec/sysstat/sa1 1 1 >/dev/null 2>&1 || true
elif [[ -x /usr/lib/sysstat/sa1 ]]; then
/usr/lib/sysstat/sa1 1 1 >/dev/null 2>&1 || true
elif [[ -x /usr/lib/sysstat/sadc ]]; then
/usr/lib/sysstat/sadc 1 1 /var/log/sysstat/sa"$(date +%d)" >/dev/null 2>&1 || true
elif command -v sadc >/dev/null 2>&1; then
sadc 1 1 /var/log/sysstat/sa"$(date +%d)" >/dev/null 2>&1 || true