File: psaccu_atop

package info (click to toggle)
atop 2.4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,692 kB
  • sloc: ansic: 20,731; python: 253; sh: 220; makefile: 170
file content (26 lines) | stat: -rw-r--r-- 541 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Logrotate file to take action after psacct is rotated
/var/log/atop/dummy_after {
    missingok
    daily
    rotate 0
    nomail
    nocompress
    ifempty
    create 0600 root root
    postrotate
	if [ -e /etc/logrotate.d/psacct ]
	then
	    # if the atop daemon does not run, restart it after
	    # accounting file is rotated
	    PIDFILE=/run/atop.pid

	    if [ -e $PIDFILE ] && \
			ps -p `cat $PIDFILE` | grep 'atop$' > /dev/null
	    then
	        :
	    else
	        /usr/share/atop/atop.daily&
	    fi
	fi
    endscript
}