tangled
alpha
login
or
join now
tjh.dev
/
nixpkgs
Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
0
fork
atom
overview
issues
pulls
pipelines
atop: 2.8.1 -> 2.10.0
Rishi Desai
2 years ago
c200802d
5219e205
+68
-47
4 changed files
expand all
collapse all
unified
split
pkgs
os-specific
linux
atop
atop.service.patch
atopacct.service.patch
default.nix
fix-paths.patch
+9
-3
pkgs/os-specific/linux/atop/atop.service.patch
···
0
0
1
--- a/atop.service
2
+++ b/atop.service
3
-
@@ -9,5 +9,6 @@
4
-
Environment=LOGPATH=/var/log/atop
0
0
5
-EnvironmentFile=/etc/default/atop
6
+EnvironmentFile=-/etc/default/atop
0
7
ExecStartPre=/bin/sh -c 'test -n "$LOGINTERVAL" -a "$LOGINTERVAL" -eq "$LOGINTERVAL"'
8
ExecStartPre=/bin/sh -c 'test -n "$LOGGENERATIONS" -a "$LOGGENERATIONS" -eq "$LOGGENERATIONS"'
9
-
+ExecStartPre=/bin/sh -c 'mkdir -p "${LOGPATH}"'
10
ExecStart=/bin/sh -c 'exec @out@/bin/atop ${LOGOPTS} -w "${LOGPATH}/atop_$(date +%%Y%%m%%d)" ${LOGINTERVAL}'
0
0
···
1
+
diff --git a/atop.service b/atop.service
2
+
index 6b11dea..f90935f 100644
3
--- a/atop.service
4
+++ b/atop.service
5
+
@@ -8,10 +8,10 @@ Environment="LOGOPTS="
6
+
Environment="LOGINTERVAL=600"
7
+
Environment="LOGGENERATIONS=28"
8
+
Environment="LOGPATH=/var/log/atop"
9
-EnvironmentFile=/etc/default/atop
10
+EnvironmentFile=-/etc/default/atop
11
+
ExecStartPre=/bin/sh -c 'test -d "${LOGPATH}" || mkdir -p "${LOGPATH}"'
12
ExecStartPre=/bin/sh -c 'test -n "$LOGINTERVAL" -a "$LOGINTERVAL" -eq "$LOGINTERVAL"'
13
ExecStartPre=/bin/sh -c 'test -n "$LOGGENERATIONS" -a "$LOGGENERATIONS" -eq "$LOGGENERATIONS"'
0
14
ExecStart=/bin/sh -c 'exec @out@/bin/atop ${LOGOPTS} -w "${LOGPATH}/atop_$(date +%%Y%%m%%d)" ${LOGINTERVAL}'
15
+
ExecStartPost=@findutils@/bin/find "${LOGPATH}" -name "atop_*" -mtime +${LOGGENERATIONS} -exec rm -v {} \;
16
+
KillSignal=SIGUSR2
-7
pkgs/os-specific/linux/atop/atopacct.service.patch
···
1
-
--- a/atopacct.service
2
-
+++ b/atopacct.service
3
-
@@ -9,3 +9,3 @@
4
-
Type=forking
5
-
-PIDFile=/var/run/atopacctd.pid
6
-
+PIDFile=/run/atopacctd.pid
7
-
ExecStart=@out@/bin/atopacctd
···
0
0
0
0
0
0
0
+6
-4
pkgs/os-specific/linux/atop/default.nix
···
1
{ lib
2
, stdenv
3
, fetchurl
0
4
, zlib
5
, ncurses
0
6
, findutils
7
, systemd
8
, python3
···
12
13
stdenv.mkDerivation rec {
14
pname = "atop";
15
-
version = "2.8.1";
16
17
src = fetchurl {
18
url = "https://www.atoptool.nl/download/atop-${version}.tar.gz";
19
-
sha256 = "sha256-lwBYoZt5w0RPlx+FRXKg5jiR3C1fcDf/g3VwhUzg2h4=";
20
};
21
22
nativeBuildInputs = lib.optionals withAtopgpu [
···
24
];
25
26
buildInputs = [
0
27
zlib
28
ncurses
0
29
] ++ lib.optionals withAtopgpu [
30
python3
31
];
···
51
./fix-paths.patch
52
# Don't fail on missing /etc/default/atop, make sure /var/log/atop exists pre-start
53
./atop.service.patch
54
-
# Specify PIDFile in /run, not /var/run to silence systemd warning
55
-
./atopacct.service.patch
56
];
57
58
preConfigure = ''
···
1
{ lib
2
, stdenv
3
, fetchurl
4
+
, glib
5
, zlib
6
, ncurses
7
+
, pkg-config
8
, findutils
9
, systemd
10
, python3
···
14
15
stdenv.mkDerivation rec {
16
pname = "atop";
17
+
version = "2.10.0";
18
19
src = fetchurl {
20
url = "https://www.atoptool.nl/download/atop-${version}.tar.gz";
21
+
hash = "sha256-56ZzzyyCV4592C7LDeyD/Z7LMIKLJWHCip+lqvddX5M=";
22
};
23
24
nativeBuildInputs = lib.optionals withAtopgpu [
···
26
];
27
28
buildInputs = [
29
+
glib
30
zlib
31
ncurses
32
+
pkg-config
33
] ++ lib.optionals withAtopgpu [
34
python3
35
];
···
55
./fix-paths.patch
56
# Don't fail on missing /etc/default/atop, make sure /var/log/atop exists pre-start
57
./atop.service.patch
0
0
58
];
59
60
preConfigure = ''
+53
-33
pkgs/os-specific/linux/atop/fix-paths.patch
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
--- a/atop.service
2
+++ b/atop.service
3
-
@@ -12,4 +12,4 @@
0
0
4
ExecStartPre=/bin/sh -c 'test -n "$LOGGENERATIONS" -a "$LOGGENERATIONS" -eq "$LOGGENERATIONS"'
5
-ExecStart=/bin/sh -c 'exec /usr/bin/atop ${LOGOPTS} -w "${LOGPATH}/atop_$(date +%%Y%%m%%d)" ${LOGINTERVAL}'
6
-ExecStartPost=/usr/bin/find "${LOGPATH}" -name "atop_*" -mtime +${LOGGENERATIONS} -exec rm -v {} \;
7
+ExecStart=/bin/sh -c 'exec @out@/bin/atop ${LOGOPTS} -w "${LOGPATH}/atop_$(date +%%Y%%m%%d)" ${LOGINTERVAL}'
8
+ExecStartPost=@findutils@/bin/find "${LOGPATH}" -name "atop_*" -mtime +${LOGGENERATIONS} -exec rm -v {} \;
9
KillSignal=SIGUSR2
10
-
11
-
--- a/atop-rotate.service
12
-
+++ b/atop-rotate.service
13
-
@@ -4,3 +4,3 @@
14
-
[Service]
15
-
Type=oneshot
16
-
-ExecStart=/usr/bin/systemctl try-restart atop.service
17
-
+ExecStart=@systemd@/bin/systemctl try-restart atop.service
18
-
0
0
0
0
0
0
0
0
19
--- a/atopgpu.service
20
+++ b/atopgpu.service
21
-
@@ -6,5 +6,5 @@
22
-
0
23
[Service]
24
-ExecStart=/usr/sbin/atopgpud
25
+ExecStart=@out@/bin/atopgpud
26
Type=oneshot
27
RemainAfterExit=yes
28
-
29
-
--- a/atopacct.service
30
-
+++ b/atopacct.service
31
-
@@ -10,3 +10,3 @@
32
-
PIDFile=/var/run/atopacctd.pid
33
-
-ExecStart=/usr/sbin/atopacctd
34
-
+ExecStart=@out@/bin/atopacctd
35
-
36
-
--- a/atop-pm.sh
37
-
+++ b/atop-pm.sh
38
-
@@ -2,8 +2,8 @@
39
-
40
-
case "$1" in
41
-
- pre) /usr/bin/systemctl stop atop
42
-
+ pre) @systemd@/bin/systemctl stop atop
43
-
exit 0
44
-
;;
45
-
- post) /usr/bin/systemctl start atop
46
-
+ post) @systemd@/bin/systemctl start atop
47
-
exit 0
48
-
;;
···
1
+
diff --git a/atop-pm.sh b/atop-pm.sh
2
+
index 3ff4ab5..c433b1a 100755
3
+
--- a/atop-pm.sh
4
+
+++ b/atop-pm.sh
5
+
@@ -1,10 +1,10 @@
6
+
#!/bin/sh
7
+
8
+
case "$1" in
9
+
- pre) /usr/bin/systemctl stop atop
10
+
+ pre) @systemd@/bin/systemctl stop atop
11
+
exit 0
12
+
;;
13
+
- post) /usr/bin/systemctl start atop
14
+
+ post) @systemd@/bin/systemctl start atop
15
+
exit 0
16
+
;;
17
+
*) exit 1
18
+
diff --git a/atop-rotate.service b/atop-rotate.service
19
+
index dbe8e0f..4eaa84d 100644
20
+
--- a/atop-rotate.service
21
+
+++ b/atop-rotate.service
22
+
@@ -4,4 +4,4 @@ Documentation=man:atop(1)
23
+
24
+
[Service]
25
+
Type=oneshot
26
+
-ExecStart=/usr/bin/systemctl restart atop.service
27
+
+ExecStart=@systemd@/bin/systemctl restart atop.service
28
+
diff --git a/atop.service b/atop.service
29
+
index 3e5bafd..6b11dea 100644
30
--- a/atop.service
31
+++ b/atop.service
32
+
@@ -12,8 +12,8 @@ EnvironmentFile=/etc/default/atop
33
+
ExecStartPre=/bin/sh -c 'test -d "${LOGPATH}" || mkdir -p "${LOGPATH}"'
34
+
ExecStartPre=/bin/sh -c 'test -n "$LOGINTERVAL" -a "$LOGINTERVAL" -eq "$LOGINTERVAL"'
35
ExecStartPre=/bin/sh -c 'test -n "$LOGGENERATIONS" -a "$LOGGENERATIONS" -eq "$LOGGENERATIONS"'
36
-ExecStart=/bin/sh -c 'exec /usr/bin/atop ${LOGOPTS} -w "${LOGPATH}/atop_$(date +%%Y%%m%%d)" ${LOGINTERVAL}'
37
-ExecStartPost=/usr/bin/find "${LOGPATH}" -name "atop_*" -mtime +${LOGGENERATIONS} -exec rm -v {} \;
38
+ExecStart=/bin/sh -c 'exec @out@/bin/atop ${LOGOPTS} -w "${LOGPATH}/atop_$(date +%%Y%%m%%d)" ${LOGINTERVAL}'
39
+ExecStartPost=@findutils@/bin/find "${LOGPATH}" -name "atop_*" -mtime +${LOGGENERATIONS} -exec rm -v {} \;
40
KillSignal=SIGUSR2
41
+
42
+
[Install]
43
+
diff --git a/atopacct.service b/atopacct.service
44
+
index 3aa529d..b95db43 100644
45
+
--- a/atopacct.service
46
+
+++ b/atopacct.service
47
+
@@ -7,7 +7,7 @@ Before=atop.service
48
+
Type=forking
49
+
PIDFile=/run/atopacctd.pid
50
+
ExecStartPre=/bin/sh -c 'if systemctl -q is-active acct psacct; then echo "Process accounting already in use by (ps)acct"; exit 1; fi'
51
+
-ExecStart=/usr/sbin/atopacctd
52
+
+ExecStart=@out@/bin/atopacctd
53
+
54
+
[Install]
55
+
WantedBy=multi-user.target
56
+
diff --git a/atopgpu.service b/atopgpu.service
57
+
index 4839235..8aae1c5 100644
58
--- a/atopgpu.service
59
+++ b/atopgpu.service
60
+
@@ -4,7 +4,7 @@ Documentation=man:atopgpud(8)
61
+
Before=atop.service
62
+
63
[Service]
64
-ExecStart=/usr/sbin/atopgpud
65
+ExecStart=@out@/bin/atopgpud
66
Type=oneshot
67
RemainAfterExit=yes
68
+
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0