3
0
Fork 0
forked from mirrors/nixpkgs

netatop: Split out path fixing and PIDFile changes to separate patches and comment

This commit is contained in:
Paul Schyska 2021-05-16 22:07:24 +02:00
parent 563ba07543
commit 27d323d281
No known key found for this signature in database
GPG key ID: D49D4F8259DB724F
3 changed files with 19 additions and 10 deletions

View file

@ -16,7 +16,12 @@ stdenv.mkDerivation {
hardeningDisable = [ "pic" ];
patches = [ ./netatop.service.patch ];
patches = [
# fix paths in netatop.service
./fix-paths.patch
# Specify PIDFile in /run, not /var/run to silence systemd warning
./netatop.service.patch
];
preConfigure = ''
patchShebangs mkversion
sed -i -e 's,^KERNDIR.*,KERNDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build,' \

View file

@ -0,0 +1,11 @@
--- a/netatop.service
+++ b/netatop.service
@@ -8,5 +8,5 @@
Type=oneshot
-ExecStartPre=/sbin/modprobe netatop
-ExecStart=/usr/sbin/netatopd
-ExecStopPost=/sbin/rmmod netatop
+ExecStartPre=@kmod@/bin/modprobe netatop
+ExecStart=@out@/bin/netatopd
+ExecStopPost=@kmod@/bin/rmmod netatop
PIDFile=/var/run/netatop.pid

View file

@ -1,14 +1,7 @@
--- a/netatop.service
+++ b/netatop.service
@@ -7,8 +7,8 @@
[Service]
Type=oneshot
-ExecStartPre=/sbin/modprobe netatop
-ExecStart=/usr/sbin/netatopd
-ExecStopPost=/sbin/rmmod netatop
@@ -11,3 +11,3 @@
ExecStopPost=@kmod@/bin/rmmod netatop
-PIDFile=/var/run/netatop.pid
+ExecStartPre=@kmod@/bin/modprobe netatop
+ExecStart=@out@/bin/netatopd
+ExecStopPost=@kmod@/bin/rmmod netatop
+PIDFile=/run/netatop.pid
RemainAfterExit=yes