I need to run some interactive programs under bash. These interactive programs can accept input from stdin to control the state such as pause, resume, stop, etc.
In order to make the best use of idle resources I need to monitor certain indicators (such as the tasks of key services, CPU load, user session conditions, etc.), and then tell the interactive program to start, suspend, or resume based on the monitored conditions.
I cannot always guard these interactive programs, and want it to be set up as automated services. Is there any way to achieve this kind of goal with the smallest possible bash programming?
Similar questions: Pause mining when using computer