[arch-commits] Commit in atop/trunk (4 files)

Ike Devolder idevolder at archlinux.org
Tue Jun 19 18:41:14 UTC 2018


    Date: Tuesday, June 19, 2018 @ 18:41:14
  Author: idevolder
Revision: 344132

upgpkg: atop 2.3.0-3

add upstream patches that allow configuration of atop.service (atop.daily)

Added:
  atop/trunk/96287919c311a17ff3c5e3d4b5ebb4507a8ddadf.patch
  atop/trunk/a88a54107142d057e36be15285c972031a0e8c0a.patch
  atop/trunk/atop.default
Modified:
  atop/trunk/PKGBUILD

------------------------------------------------+
 96287919c311a17ff3c5e3d4b5ebb4507a8ddadf.patch |  172 +++++++++++++++++++++++
 PKGBUILD                                       |   20 ++
 a88a54107142d057e36be15285c972031a0e8c0a.patch |   39 +++++
 atop.default                                   |    3 
 4 files changed, 231 insertions(+), 3 deletions(-)

Added: 96287919c311a17ff3c5e3d4b5ebb4507a8ddadf.patch
===================================================================
--- 96287919c311a17ff3c5e3d4b5ebb4507a8ddadf.patch	                        (rev 0)
+++ 96287919c311a17ff3c5e3d4b5ebb4507a8ddadf.patch	2018-06-19 18:41:14 UTC (rev 344132)
@@ -0,0 +1,172 @@
+From 96287919c311a17ff3c5e3d4b5ebb4507a8ddadf Mon Sep 17 00:00:00 2001
+From: Gerlof Langeveld <gerlof.langeveld at atoptool.nl>
+Date: Sat, 9 Jun 2018 12:06:49 +0200
+Subject: [PATCH] Modify default values in atop.daily script Add possibility to
+ override all necessary default values in the atop.daily script, i.e. variable
+ LOGOPTS, LOGINTERVAL and LOGGENERATIONS.
+
+---
+ atop.daily | 47 ++++++++++++++++++++++++++++++++---------------
+ man/atop.1 | 51 ++++++++++++++++++++++++++++++++++++++++++++-------
+ 2 files changed, 76 insertions(+), 22 deletions(-)
+
+diff --git a/atop.daily b/atop.daily
+index 3539e62..57a9507 100755
+--- a/atop.daily
++++ b/atop.daily
+@@ -1,21 +1,42 @@
+ #!/bin/bash
+ 
++LOGOPTS="-R"				# default options
++LOGINTERVAL=600				# default interval in seconds
++LOGGENERATIONS=28			# default number of days
++
++# allow administrator to overrule the variables
++# defined above
++#
++DEFAULTSFILE=/etc/default/atop		# possibility to overrule vars
++
++if [ -e "$DEFAULTSFILE" ]
++then
++	. "$DEFAULTSFILE"
++
++	# validate overruled variables
++	# (LOGOPTS and LOGINTERVAL are implicitly by atop)
++	#
++ 	case "$LOGGENERATIONS" in
++	    ''|*[!0-9]*)
++		echo non-numerical value for LOGGENERATIONS >&2
++		exit 1;;
++	esac
++fi
++
+ CURDAY=`date +%Y%m%d`
+ LOGPATH=/var/log/atop
+ BINPATH=/usr/bin
+ PIDFILE=/var/run/atop.pid
+-DEFAULTSFILE=/etc/default/atop
+-INTERVAL=600				# interval 10 minutes
+ 
+ # verify if atop still runs for daily logging
+ #
+-if [ -e $PIDFILE ] && ps -p `cat $PIDFILE` | grep 'atop$' > /dev/null
++if [ -e "$PIDFILE" ] && ps -p `cat "$PIDFILE"` | grep 'atop$' > /dev/null
+ then
+-	kill -USR2 `cat $PIDFILE`       # final sample and terminate
++	kill -USR2 `cat "$PIDFILE"`       # final sample and terminate
+ 
+ 	CNT=0
+ 
+-	while ps -p `cat $PIDFILE` > /dev/null
++	while ps -p `cat "$PIDFILE"` > /dev/null
+ 	do
+ 		let CNT+=1
+ 
+@@ -27,21 +48,17 @@ then
+ 		sleep 1
+ 	done
+ 
+-	rm $PIDFILE
+-fi
+-
+-ATOPOPTS="-R"
+-if [ -e "$DEFAULTSFILE" ]; then
+-	. "$DEFAULTSFILE"
++	rm "$PIDFILE"
+ fi
+ 
+-# delete logfiles older than four weeks
++# delete logfiles older than N days (configurable)
+ # start a child shell that activates another child shell in
+ # the background to avoid a zombie
+ #
+-( (sleep 3; find $LOGPATH -name 'atop_*' -mtime +28 -exec rm {} \;)& )
++( (sleep 3; find "$LOGPATH" -name 'atop_*' -mtime +"$LOGGENERATIONS" -exec rm {} \;)& )
+ 
+-# activate atop with interval of 10 minutes, replacing the current shell
++# activate atop with an interval of S seconds (configurable),
++# replacing the current shell
+ #
+ echo $$ > $PIDFILE
+-exec $BINPATH/atop $ATOPOPTS -w $LOGPATH/atop_$CURDAY $INTERVAL > $LOGPATH/daily.log 2>&1
++exec $BINPATH/atop $LOGOPTS -w "$LOGPATH"/atop_"$CURDAY" "$LOGINTERVAL" > "$LOGPATH/daily.log" 2>&1
+diff --git a/man/atop.1 b/man/atop.1
+index 17ad69f..7866e49 100644
+--- a/man/atop.1
++++ b/man/atop.1
+@@ -1,4 +1,4 @@
+-.TH ATOP 1 "March 2017" "Linux"
++.TH ATOP 1 "June 2018" "Linux"
+ .SH NAME
+ .B atop 
+ - Advanced System & Process Monitor
+@@ -859,11 +859,29 @@ This scripts takes care that
+ .B atop
+ is activated every day at midnight to write compressed binary data to the file
+ .BI /var/log/atop/atop_ YYYYMMDD
+-with an interval of 10 minutes.
+-.br
+-Furthermore the script removes all raw files which are older than four weeks.
+-.br
+-The script is activated via the
++with an interval of 10 minutes by default. The
++.B -R
++flag is passed by default to gather information about the proportional
++set size of every process.
++.br
++Furthermore the script removes all raw files which are by default
++older than 28 days.
++.br
++The mentioned default values can be overruled by creating the file
++.B /etc/default/atop
++that might contain other values for
++.B LOGOPTS
++(by default the
++.B -R
++flag), 
++.B LOGINTERVAL
++(in seconds, by default 600), and
++.B LOGGENERATIONS
++(in days, by default 28).
++.PP
++The
++.B atop.daily
++script is activated via the
+ .B cron
+ daemon using the file
+ .I /etc/cron.d/atop
+@@ -2092,6 +2110,25 @@ Configuration file containing personal default values.
+ See related man-page.
+ .PP
+ .TP 5
++.B /etc/default/atop
++Configuration file to overrule the settings of
++.I atop
++that runs in the background to create the daily logfile.
++This file is not created or overwritten when
++.I atop
++is installed, so it has to be created manually to override
++the default settings.
++The default settings are:
++.TP 8
++\ 
++.br
++LOGOPTS="-R"
++.br
++LOGINTERVAL=600
++.br
++LOGGENERATIONS=28
++.PP
++.TP 5
+ .BI /var/log/atop/atop_ YYYYMMDD
+ Raw file, where
+ .I YYYYMMDD
+@@ -2123,7 +2160,7 @@ after reading the standard process accounting records.
+ .B netatopd(8),
+ .B logrotate(8)
+ .br
+-.B http://www.atoptool.nl
++.B https://www.atoptool.nl
+ .SH AUTHOR
+ Gerlof Langeveld (gerlof.langeveld at atoptool.nl)
+ .br

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-06-19 17:52:16 UTC (rev 344131)
+++ PKGBUILD	2018-06-19 18:41:14 UTC (rev 344132)
@@ -5,15 +5,28 @@
 
 pkgname=atop
 pkgver=2.3.0
-pkgrel=2
+pkgrel=3
 pkgdesc='A system and process level monitor'
 arch=('x86_64')
 url='http://www.atoptool.nl/'
 license=('GPL')
 depends=('ncurses' 'sh' 'zlib' 'cron')
-source=("https://www.atoptool.nl/download/atop-${pkgver/_/-}.tar.gz")
-sha512sums=('51cc868545403cab439a66cc38fe9324c6ff7537e6dad5271fa3f0a22cbad471b0e15186d4f78f0080129301ba0a59e0c1cd1cc694bc3a4f982118a8d0cae429')
+backup=('etc/default/atop')
+source=("https://www.atoptool.nl/download/atop-${pkgver/_/-}.tar.gz"
+        'atop.default'
+        'a88a54107142d057e36be15285c972031a0e8c0a.patch'
+        '96287919c311a17ff3c5e3d4b5ebb4507a8ddadf.patch')
+sha512sums=('51cc868545403cab439a66cc38fe9324c6ff7537e6dad5271fa3f0a22cbad471b0e15186d4f78f0080129301ba0a59e0c1cd1cc694bc3a4f982118a8d0cae429'
+            '472a43abfe4bab9169ffce0f365547d646c6a4edb43b4092e893541d6641832cabcf9d8c9ab0332018854d9de5cf2d88a66cdcc5aaa75702cffd83ccb917fc34'
+            'af408a65bc31af192462bd2eee2870523df545ef5ab3397208e04e9eed299e9cc4c16a55a5fa2ad334a7ca7561ad7e414855decb1f35c189705b2e34d5a5577f'
+            '2ccc011dab712909be68f5b0940f42e635944c710839665323594bbc04f729bacbf9494a9cb547fd4020cbf1a7dcf4882f4e8416556d7991ba2e0cbb962d9f94')
 
+prepare() {
+    cd "$pkgname-$pkgver"
+    patch -p1 -i "$srcdir/a88a54107142d057e36be15285c972031a0e8c0a.patch"
+    patch -p1 -i "$srcdir/96287919c311a17ff3c5e3d4b5ebb4507a8ddadf.patch"
+}
+
 build() {
     cd "$pkgname-$pkgver"
     make
@@ -22,4 +35,5 @@
 package() {
     cd "$pkgname-$pkgver"
     make DESTDIR="$pkgdir" systemdinstall SBINPATH=/usr/bin
+    install -Dm644 "$srcdir/atop.default" "$pkgdir/etc/default/atop"
 }

Added: a88a54107142d057e36be15285c972031a0e8c0a.patch
===================================================================
--- a88a54107142d057e36be15285c972031a0e8c0a.patch	                        (rev 0)
+++ a88a54107142d057e36be15285c972031a0e8c0a.patch	2018-06-19 18:41:14 UTC (rev 344132)
@@ -0,0 +1,39 @@
+From a88a54107142d057e36be15285c972031a0e8c0a Mon Sep 17 00:00:00 2001
+From: Marc Haber <mh+mr-git at zugschlus.de>
+Date: Tue, 24 Apr 2018 11:42:53 +0200
+Subject: [PATCH] make atop options configurable, introduce config file
+
+---
+ atop.daily | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/atop.daily b/atop.daily
+index 32a94d8..3539e62 100755
+--- a/atop.daily
++++ b/atop.daily
+@@ -4,6 +4,7 @@ CURDAY=`date +%Y%m%d`
+ LOGPATH=/var/log/atop
+ BINPATH=/usr/bin
+ PIDFILE=/var/run/atop.pid
++DEFAULTSFILE=/etc/default/atop
+ INTERVAL=600				# interval 10 minutes
+ 
+ # verify if atop still runs for daily logging
+@@ -29,6 +30,11 @@ then
+ 	rm $PIDFILE
+ fi
+ 
++ATOPOPTS="-R"
++if [ -e "$DEFAULTSFILE" ]; then
++	. "$DEFAULTSFILE"
++fi
++
+ # delete logfiles older than four weeks
+ # start a child shell that activates another child shell in
+ # the background to avoid a zombie
+@@ -38,4 +44,4 @@ fi
+ # activate atop with interval of 10 minutes, replacing the current shell
+ #
+ echo $$ > $PIDFILE
+-exec $BINPATH/atop -R -w $LOGPATH/atop_$CURDAY $INTERVAL > $LOGPATH/daily.log 2>&1
++exec $BINPATH/atop $ATOPOPTS -w $LOGPATH/atop_$CURDAY $INTERVAL > $LOGPATH/daily.log 2>&1

Added: atop.default
===================================================================
--- atop.default	                        (rev 0)
+++ atop.default	2018-06-19 18:41:14 UTC (rev 344132)
@@ -0,0 +1,3 @@
+#LOGOPTS="-R"      # default options
+#LOGINTERVAL=600   # default interval in seconds
+#LOGGENERATIONS=28 # default number of days



More information about the arch-commits mailing list