I put an entry out here that detailed how to find the process ID of a running process and then how to re-nice it from within a bash shell script. This first script referenced processes that could be identified by a single pid. But what about processes that spawn multiple pids, or multiple processes that are all named the same but are, in fact, separate instances?
Here is a small bash script segment that identifies process PIDs; puts them into an array; then uses that array to renice the processes. In this case, the processes are VoIP applications that use RTP (real time protocol), and, in particular SIP (Session Initiation Protocol) to put voice traffic on the wire and usually need immediate CPU access.
This script does many things before it gets to this point… we pick it up here at the renice process… Note that some of the variables you see here were instantiated early in the script. Also, to get the code to fit neatly on the page here, I took out a lot of the formatting of the echo statements that allows for clear logging…
Read more »



