Phobetor / rabbitmq-supervisor-bundle

Symfony bundle to automatically create and update supervisor configurations for RabbitMQ consumer daemons
MIT License
104 stars 42 forks source link

Unable to detect running processes on Alpine-based system #38

Closed gregurco closed 6 years ago

gregurco commented 6 years ago

The problem is that in alpine ps command ignores PID argument. So, when you run ps 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:

Similar problem: https://github.com/chef/inspec/issues/2034

gregurco commented 6 years ago

ping @Phobetor

Phobetor commented 6 years ago

@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.

Phobetor commented 6 years ago

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!

gregurco commented 6 years ago

@Phobetor yep, it's working :slightly_smiling_face: :+1:

Phobetor commented 6 years ago

@gregurco great, thanks!