diff options
Diffstat (limited to 'main/atop/atop-bb-compat.patch')
-rw-r--r-- | main/atop/atop-bb-compat.patch | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/main/atop/atop-bb-compat.patch b/main/atop/atop-bb-compat.patch new file mode 100644 index 000000000..ec46d2426 --- /dev/null +++ b/main/atop/atop-bb-compat.patch @@ -0,0 +1,30 @@ +diff --git a/atop.daily b/atop.daily +index e0d994f..8c0cfc0 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,11 +7,15 @@ INTERVAL=600 # interval 10 minutes + + # verify if atop still runs for daily logging + # +-if [ -e $PIDFILE ] && ps -p `cat $PIDFILE` | grep 'atop$' > /dev/null +-then +- kill -USR1 `cat $PIDFILE` # take final sample ++pid= ++if [ -e $PIDFILE ]; then ++ pid=$(cat $PIDFILE) ++fi ++ ++if [ -n "$pid" ] && [ -d /proc/$pid ]; then ++ kill -USR1 $pid # take final sample + sleep 3 +- kill -TERM `cat $PIDFILE` ++ kill -TERM $pid + rm $PIDFILE + sleep 1 + fi |