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