aboutsummaryrefslogtreecommitdiffstats
path: root/main/atop/atop-bb-compat.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/atop/atop-bb-compat.patch')
-rw-r--r--main/atop/atop-bb-compat.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/main/atop/atop-bb-compat.patch b/main/atop/atop-bb-compat.patch
new file mode 100644
index 0000000000..66e45234ae
--- /dev/null
+++ b/main/atop/atop-bb-compat.patch
@@ -0,0 +1,35 @@
+diff --git a/atop.daily b/atop.daily
+index c72214c..ac4b3b7 100755
+--- a/atop.daily
++++ b/atop.daily
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ CURDAY=`date +%Y%m%d`
+ LOGPATH=/var/log/atop
+ BINPATH=/usr/bin
+@@ -7,15 +7,20 @@ INTERVAL=600 # interval 10 minutes
+
+ # verify if atop still runs for daily logging
+ #
+-if [ -e $PIDFILE ] && ps -p `cat $PIDFILE` | grep 'atop$' > /dev/null
++pid=
++if [ -e $PIDFILE ]; then
++ pid=$(cat $PIDFILE)
++fi
++
++if [ -n "$pid" ] && [ -d /proc/$pid ]
+ then
+- kill -USR2 `cat $PIDFILE` # final sample and terminate
++ kill -USR2 $pid # final sample and terminate
+
+ CNT=0
+
+- while ps -p `cat $PIDFILE` > /dev/null
++ while [ -d /proc/$pid ]
+ do
+- let CNT+=1
++ CNT=$(($CNT + 1))
+
+ if [ $CNT -gt 5 ]
+ then