Closed gregurco closed 6 years ago
ping @Phobetor
@gregurco Thanks for this particular fix. And thanks for the optimization in general. It is much more reliable, now. Even if the output format should change for some reason.
Hi @gregurco
Thank you very much again for this pull request!
It is merged to dev-master and released in version 3.0.0.
I had to fix the call to ps
to make it run on ubuntu/debian. I changed it from
ps %d -o pid
to
ps -o pid %d
Can you please verify if this is also working on alpine?
Thanks in advance!
@Phobetor yep, it's working :slightly_smiling_face: :+1:
@gregurco great, thanks!
The problem is that in alpine
ps
command ignores PID argument. So, when you runps 1
you always will receive ALL processes. I added-o pid
to command to remove useless data and to leave only PIDs and added one more condition to detect if process is running, so finally the process is running if:ps
commandSimilar problem: https://github.com/chef/inspec/issues/2034