So I have some processes that run background jobs (resque) on servers and some of those jobs start a child process that occasionally gets stuck. I've found if I kill that child process everything goes back to normal. We have another script that can kill a binary process if it goes to long but it doesn't seem to work here. Usually I can do this:
killall --older-than 20m <process>
But these workers seem to be a little more tricky. Here is how they look in ps:
jbsmith@server:~$ ps aux | grep resque www-data 17652 0.0 1.8 794148 145940 ? Sl 11:03 0:05 resque-1.26.0: Processing email since 1494525823 [Email] www-data 1026 0.0 1.9 787712 157080 ? Sl 10:47 0:13 resque-1.26.0: Forked 17652 at 1494525823
The "Forked x at x" is the child process and the one I need to kill. Is there a one liner command I can use to find processes maybe matching "Forked" and older than 20 minutes and kill them?