atop icon indicating copy to clipboard operation
atop copied to clipboard

atop.daily: removed dependency from procps

Open fcolista opened this issue 8 years ago • 5 comments

This patch allows atop to not work only with procps, but with busybox ps too. Distribution with small amount of packages and embedded systems can benefit from this. Thanks for considering. .:Francesco Colista

fcolista avatar Sep 06 '17 12:09 fcolista

Development is certainly not frozen.

Atoptool avatar Sep 23 '17 10:09 Atoptool

In my opinion, the proposed modification does not work properly any more with procps ps since no flags are passed (ps does not show the daemon processes, like atop). I propose another modification that does not depend on ps any more:

  if  [ -e $PIDFILE ]  &&  grep  -q  'atop$'  /proc/`cat $PIDFILE`/comm

Can you confirm that this works with busybox?

Atoptool avatar Sep 23 '17 10:09 Atoptool

It works, but after thinking a little bit more, I think that it's better to use "pidof". This is implemented both in procps and in busybox too:

if [ -e $PIDFILE ] && pidof atop|awk '{print $1}';

Francesco

fcolista avatar Sep 25 '17 07:09 fcolista

If more atop processes are active (e.g. the daemon running in the background and a couple of interactive atop processes in the foreground), pidof shows more that one PID. You still don't know which PID is the one related to the background atop (the PID that should be compared to the PID found in the pid file).

Gerlof

Atoptool avatar Sep 25 '17 19:09 Atoptool