Public bug reported:
I'm presently running 16.04LTS. On that version atop's init script has
the log retention period hardcoded to 28 days.
It would be better if the log retention period was set using a variable
which could be modified in the /etc/default/atop file.
Here are two proposed patches that would resolve the issue:
--- /etc/init.d/atop.orig 2017-09-09 17:02:09.289551900 -0700
+++ /etc/init.d/atop 2017-09-09 17:00:36.972505450 -0700
@@ -26,6 +26,7 @@
WRAPPER=/usr/share/atop/atop.wrapper
INTERVAL=600 # interval 10 minutes
LOGPATH="/var/log/atop"
+RETENTION=28
OUTFILE=$LOGPATH/daily.log
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
@@ -111,7 +112,7 @@
do_start
case "$?" in
0) [ "$VERBOSE" != no ] && log_end_msg 0
- [ "$1" = "_cron" ] && sleep 3 && find $LOGPATH -name
'atop_*' -mtime +28 -exec rm {} \;
+ [ "$1" = "_cron" ] && sleep 3 && find $LOGPATH -name
'atop_*' -mtime +$RETENTION -exec rm {} \;
;;
1) [ "$VERBOSE" != no ] && log_end_msg 1 ;; # Old
process is still running
*) [ "$VERBOSE" != no ] && log_end_msg 1 ;; # Failed
to start
--- /etc/default/atop.orig 2017-09-09 17:01:39.077209432 -0700
+++ /etc/default/atop 2017-09-09 17:03:03.202163022 -0700
@@ -3,3 +3,4 @@
INTERVAL=600
LOGPATH="/var/log/atop"
OUTFILE="$LOGPATH/daily.log"
+RETENTION=28
** Affects: atop (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1716186
Title:
log retention time period should not be hardcoded
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/atop/+bug/1716186/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs