As a little info on why I need this:
We are starting regular processes in regular intervalls, say every minute, using crontab. Most of the times, such a process does a short job and is done within a few seconds, but it can also take longer.
Sometimes (pattern unknown so far) these processes start to eat up 100% and more cpu, but don't start their actual work. They just keep running at 100.x % CPU usage and thus add load to the machine.
Sometimes, these processes end after a few or 20 minutes or so, sometimes the don't. This leads to the fact, that every minute, another one starts, and this may or may not just do its job in a few seconds, but sometimes, this new one also eats up 100% cpu and lingers on the machine.
Over time, this can block all CPUs on the server, which is not such a wonderful result for our users.
So I'd need to see the PID of the blocking processes, so that I can better understand what they are actually doing. So far, they all write to the same log file, so there is a colourful mix of log output from multiple images in one single log file.
Maybe I am just overseeing some other obvious way of getting these logs sorted.
And yes, I could write a bash scrpt that only starts a new instance of the process if no older one is running. But what if that older one is not doing its job but just loops in whatever endless loop it may be in? The job won't get done...
Joachim