merge acct compat change from experimental
Marc Haber
2 years ago
1 | 1 | Author: Marc Haber <mh+debian-packages@zugschlus.de> |
2 | 2 | Forwarded: not yet |
3 | 3 | Last-Update: 2019-02-17 |
4 | --- a/acctproc.c | |
5 | +++ b/acctproc.c | |
4 | Index: atop/acctproc.c | |
5 | =================================================================== | |
6 | --- atop.orig/acctproc.c | |
7 | +++ atop/acctproc.c | |
6 | 8 | @@ -158,7 +158,8 @@ struct pacctadm { |
7 | 9 | struct stat stat; |
8 | 10 | } pacctadm[] = { |
13 | 15 | }; |
14 | 16 | |
15 | 17 | /* |
16 | --- a/atopacct.init | |
17 | +++ b/atopacct.init | |
18 | Index: atop/atopacct.init | |
19 | =================================================================== | |
20 | --- atop.orig/atopacct.init | |
21 | +++ atop/atopacct.init | |
18 | 22 | @@ -29,7 +29,7 @@ case "$1" in |
19 | 23 | start) |
20 | 24 | # Check if process accounting already in use via psacct |
24 | 28 | do |
25 | 29 | if [ -f "$PACCTFILE" ] # file exists? |
26 | 30 | then |
27 | --- a/man/atop.1 | |
28 | +++ b/man/atop.1 | |
31 | Index: atop/man/atop.1 | |
32 | =================================================================== | |
33 | --- atop.orig/man/atop.1 | |
34 | +++ atop/man/atop.1 | |
29 | 35 | @@ -162,11 +162,14 @@ daemon is not active, |
30 | 36 | verifies if the process accounting mechanism has been switched on |
31 | 37 | via the separate |
45 | 51 | .PP |
46 | 52 | .TP 4 |
47 | 53 | 4. |
48 | --- a/psaccs_atop | |
49 | +++ b/psaccs_atop | |
50 | @@ -10,11 +10,12 @@ | |
54 | Index: atop/psaccs_atop | |
55 | =================================================================== | |
56 | --- atop.orig/psaccs_atop | |
57 | +++ atop/psaccs_atop | |
58 | @@ -10,11 +10,18 @@ | |
51 | 59 | postrotate |
52 | 60 | # check if process accounting is installed |
53 | 61 | # |
59 | 67 | - ACCTFILE=`awk '$2 == "{" {print $1}' /etc/logrotate.d/psacct` |
60 | 68 | + # this is a heuristic that will fail once acct's cron.daily job changes |
61 | 69 | + # please file a bug report against atop if you encounter this |
62 | + ACCTFILE=$(sed -n "/savelog[^\/]\+\(\/[[:alnum:]\/]\+\).*/{s//\1/;p;q;}" /etc/cron.daily/acct) | |
70 | + then | |
71 | + ACCTFILE="$(awk '$2 == "{" {print $1}' /etc/logrotate.d/psacct)" | |
72 | + fi | |
73 | + if grep -q 'savelog' /etc/cron.daily/acct | |
74 | + then | |
75 | + ACCTFILE="$(sed -n "/savelog[^\/]\+\(\/[[:alnum:]\/]\+\).*/{s//\1/;p;q;}" /etc/cron.daily/acct)" | |
76 | + fi | |
63 | 77 | |
64 | 78 | if [ -f "$ACCTFILE" ] |
65 | 79 | then |
66 | --- a/psaccu_atop | |
67 | +++ b/psaccu_atop | |
80 | Index: atop/psaccu_atop | |
81 | =================================================================== | |
82 | --- atop.orig/psaccu_atop | |
83 | +++ atop/psaccu_atop | |
68 | 84 | @@ -8,7 +8,7 @@ |
69 | 85 | ifempty |
70 | 86 | create 0600 root root |