25 lines
584 B
Diff
25 lines
584 B
Diff
--- a/atop.daily 2021-10-11 10:06:37.318316573 -0400
|
|
+++ b/atop.daily 2021-10-11 10:10:51.593483875 -0400
|
|
@@ -30,13 +30,18 @@
|
|
|
|
# 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
|
|
CNT=$((CNT + 1))
|
|
|