arturictus / sidekiq_alive

Liveness probe for Sidekiq in Kubernetes deployments
MIT License
194 stars 57 forks source link

Question: why grep busy in graceful shutdown #47

Closed flovilmart closed 3 years ago

flovilmart commented 3 years ago

Hi! Thanks for maintaining this project.

When integrating, one of my coworkers came with this question:

#!/bin/bash

# Find Pid
SIDEKIQ_PID=$(ps aux | grep sidekiq | grep busy | awk '{ print $2 }')

Why grep busy? Could this possibly not match sometimes? If so, would need to be handled below

Any chance you can clarify for us the need for busy?

thanks!

arturictus commented 3 years ago

Hi @flovilmart, Thanks for pointing out. This code is an example script to find the PID managing the sidekiq process, the busy is a way to select the right one. If you have a better way I'm happy to change the docs, even add it into the lib. Here is my output in console: image

flovilmart commented 3 years ago

Gotcha! Thanks for the explanation.