atop: Merge all path-fixing to a single patch, comment the remaining patches
This commit is contained in:
parent
27d323d281
commit
76554beed8
@ -1,13 +0,0 @@
|
||||
--- a/atop-pm.sh
|
||||
+++ b/atop-pm.sh
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
case "$1" in
|
||||
- pre) /usr/bin/systemctl stop atop
|
||||
+ pre) @systemd@/bin/systemctl stop atop
|
||||
exit 0
|
||||
;;
|
||||
- post) /usr/bin/systemctl start atop
|
||||
+ post) @systemd@/bin/systemctl start atop
|
||||
exit 0
|
||||
;;
|
@ -1,7 +0,0 @@
|
||||
--- a/atop-rotate.service
|
||||
+++ b/atop-rotate.service
|
||||
@@ -4,3 +4,3 @@
|
||||
[Service]
|
||||
Type=oneshot
|
||||
-ExecStart=/usr/bin/systemctl try-restart atop.service
|
||||
+ExecStart=@systemd@/bin/systemctl try-restart atop.service
|
@ -1,14 +1,10 @@
|
||||
--- a/atop.service
|
||||
+++ b/atop.service
|
||||
@@ -9,7 +9,8 @@
|
||||
@@ -9,5 +9,6 @@
|
||||
Environment=LOGPATH=/var/log/atop
|
||||
-EnvironmentFile=/etc/default/atop
|
||||
+EnvironmentFile=-/etc/default/atop
|
||||
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 /usr/bin/atop ${LOGOPTS} -w "${LOGPATH}/atop_$(date +%%Y%%m%%d)" ${LOGINTERVAL}'
|
||||
-ExecStartPost=/usr/bin/find "${LOGPATH}" -name "atop_*" -mtime +${LOGGENERATIONS} -exec rm -v {} \;
|
||||
+ExecStartPre=/bin/sh -c 'mkdir -p "${LOGPATH}"'
|
||||
+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
|
||||
ExecStart=/bin/sh -c 'exec @out@/bin/atop ${LOGOPTS} -w "${LOGPATH}/atop_$(date +%%Y%%m%%d)" ${LOGINTERVAL}'
|
||||
|
@ -1,11 +1,7 @@
|
||||
--- a/atopacct.service
|
||||
+++ b/atopacct.service
|
||||
@@ -8,6 +8,6 @@
|
||||
[Service]
|
||||
@@ -9,3 +9,3 @@
|
||||
Type=forking
|
||||
-PIDFile=/var/run/atopacctd.pid
|
||||
-ExecStart=/usr/sbin/atopacctd
|
||||
+PIDFile=/run/atopacctd.pid
|
||||
+ExecStart=@out@/bin/atopacctd
|
||||
|
||||
[Install]
|
||||
ExecStart=@out@/bin/atopacctd
|
||||
|
@ -1,9 +0,0 @@
|
||||
--- a/atopgpu.service
|
||||
+++ b/atopgpu.service
|
||||
@@ -6,5 +6,5 @@
|
||||
|
||||
[Service]
|
||||
-ExecStart=/usr/sbin/atopgpud
|
||||
+ExecStart=@out@/bin/atopgpud
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
@ -35,11 +35,14 @@ stdenv.mkDerivation rec {
|
||||
];
|
||||
|
||||
patches = [
|
||||
./atop-pm.sh.patch
|
||||
./atop-rotate.service.patch
|
||||
# Fix paths in atop.service, atop-rotate.service, atopgpu.service, atopacct.service,
|
||||
# and atop-pm.sh
|
||||
./fix-paths.patch
|
||||
# Don't fail on missing /etc/default/atop, make sure /var/log/atop exists pre-start
|
||||
./atop.service.patch
|
||||
# Specify PIDFile in /run, not /var/run to silence systemd warning
|
||||
./atopacct.service.patch
|
||||
] ++ (if withAtopgpu then [ ./atopgpu.service.patch ] else [ ]);
|
||||
];
|
||||
|
||||
preConfigure = ''
|
||||
for f in *.{sh,service}; do
|
||||
|
48
pkgs/os-specific/linux/atop/fix-paths.patch
Normal file
48
pkgs/os-specific/linux/atop/fix-paths.patch
Normal file
@ -0,0 +1,48 @@
|
||||
--- a/atop.service
|
||||
+++ b/atop.service
|
||||
@@ -12,4 +12,4 @@
|
||||
ExecStartPre=/bin/sh -c 'test -n "$LOGGENERATIONS" -a "$LOGGENERATIONS" -eq "$LOGGENERATIONS"'
|
||||
-ExecStart=/bin/sh -c 'exec /usr/bin/atop ${LOGOPTS} -w "${LOGPATH}/atop_$(date +%%Y%%m%%d)" ${LOGINTERVAL}'
|
||||
-ExecStartPost=/usr/bin/find "${LOGPATH}" -name "atop_*" -mtime +${LOGGENERATIONS} -exec rm -v {} \;
|
||||
+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
|
||||
|
||||
--- a/atop-rotate.service
|
||||
+++ b/atop-rotate.service
|
||||
@@ -4,3 +4,3 @@
|
||||
[Service]
|
||||
Type=oneshot
|
||||
-ExecStart=/usr/bin/systemctl try-restart atop.service
|
||||
+ExecStart=@systemd@/bin/systemctl try-restart atop.service
|
||||
|
||||
--- a/atopgpu.service
|
||||
+++ b/atopgpu.service
|
||||
@@ -6,5 +6,5 @@
|
||||
|
||||
[Service]
|
||||
-ExecStart=/usr/sbin/atopgpud
|
||||
+ExecStart=@out@/bin/atopgpud
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
|
||||
--- a/atopacct.service
|
||||
+++ b/atopacct.service
|
||||
@@ -10,3 +10,3 @@
|
||||
PIDFile=/var/run/atopacctd.pid
|
||||
-ExecStart=/usr/sbin/atopacctd
|
||||
+ExecStart=@out@/bin/atopacctd
|
||||
|
||||
--- a/atop-pm.sh
|
||||
+++ b/atop-pm.sh
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
case "$1" in
|
||||
- pre) /usr/bin/systemctl stop atop
|
||||
+ pre) @systemd@/bin/systemctl stop atop
|
||||
exit 0
|
||||
;;
|
||||
- post) /usr/bin/systemctl start atop
|
||||
+ post) @systemd@/bin/systemctl start atop
|
||||
exit 0
|
||||
;;
|
Loading…
Reference in New Issue
Block a user