nixpkgs/pkgs/os-specific/linux/atop/atop.service.patch
2024-07-10 15:57:34 -05:00

16 lines
816 B
Diff

diff --git a/atop.service b/atop.service
index 6b11dea..f90935f 100644
--- a/atop.service
+++ b/atop.service
@@ -8,10 +8,10 @@ Environment="LOGOPTS="
Environment="LOGINTERVAL=600"
Environment="LOGGENERATIONS=28"
Environment="LOGPATH=/var/log/atop"
-EnvironmentFile=/etc/default/atop
+EnvironmentFile=-/etc/default/atop
ExecStartPre=/bin/sh -c 'test -d "${LOGPATH}" || mkdir -p "${LOGPATH}"'
ExecStartPre=/bin/sh -c 'test -n "$LOGINTERVAL" -a "$LOGINTERVAL" -eq "$LOGINTERVAL"'
ExecStartPre=/bin/sh -c 'test -n "$LOGGENERATIONS" -a "$LOGGENERATIONS" -eq "$LOGGENERATIONS"'
ExecStart=/bin/sh -c 'exec @out@/bin/atop ${LOGOPTS} -w "${LOGPATH}/atop_$(date +%%Y%%m%%d)" ${LOGINTERVAL}'
ExecStartPost=@findutils@/bin/find "${LOGPATH}" -name "atop_*" -mtime +${LOGGENERATIONS} -exec rm -v {} \;
KillSignal=SIGUSR2