mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-09-11 15:08:33 +01:00
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
|
--- a/atop.service
|
||||||
+++ b/atop.service
|
+++ b/atop.service
|
||||||
@@ -9,7 +9,8 @@
|
@@ -9,5 +9,6 @@
|
||||||
Environment=LOGPATH=/var/log/atop
|
Environment=LOGPATH=/var/log/atop
|
||||||
-EnvironmentFile=/etc/default/atop
|
-EnvironmentFile=/etc/default/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 "$LOGINTERVAL" -a "$LOGINTERVAL" -eq "$LOGINTERVAL"'
|
||||||
ExecStartPre=/bin/sh -c 'test -n "$LOGGENERATIONS" -a "$LOGGENERATIONS" -eq "$LOGGENERATIONS"'
|
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}"'
|
+ExecStartPre=/bin/sh -c 'mkdir -p "${LOGPATH}"'
|
||||||
+ExecStart=/bin/sh -c 'exec @out@/bin/atop ${LOGOPTS} -w "${LOGPATH}/atop_$(date +%%Y%%m%%d)" ${LOGINTERVAL}'
|
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
|
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
--- a/atopacct.service
|
--- a/atopacct.service
|
||||||
+++ b/atopacct.service
|
+++ b/atopacct.service
|
||||||
@@ -8,6 +8,6 @@
|
@@ -9,3 +9,3 @@
|
||||||
[Service]
|
|
||||||
Type=forking
|
Type=forking
|
||||||
-PIDFile=/var/run/atopacctd.pid
|
-PIDFile=/var/run/atopacctd.pid
|
||||||
-ExecStart=/usr/sbin/atopacctd
|
|
||||||
+PIDFile=/run/atopacctd.pid
|
+PIDFile=/run/atopacctd.pid
|
||||||
+ExecStart=@out@/bin/atopacctd
|
ExecStart=@out@/bin/atopacctd
|
||||||
|
|
||||||
[Install]
|
|
||||||
|
|
|
@ -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 = [
|
patches = [
|
||||||
./atop-pm.sh.patch
|
# Fix paths in atop.service, atop-rotate.service, atopgpu.service, atopacct.service,
|
||||||
./atop-rotate.service.patch
|
# 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
|
./atop.service.patch
|
||||||
|
# Specify PIDFile in /run, not /var/run to silence systemd warning
|
||||||
./atopacct.service.patch
|
./atopacct.service.patch
|
||||||
] ++ (if withAtopgpu then [ ./atopgpu.service.patch ] else [ ]);
|
];
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
for f in *.{sh,service}; do
|
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 a new issue