OpenCDSS / cdss-app-tstool-main

Colorado's Decision Support Systems (CDSS) TSTool application main program
GNU General Public License v3.0
1 stars 1 forks source link

RunProgram - need to handle background processes #212

Open smalers opened 2 years ago

smalers commented 2 years ago

Subject of the issue

On Linux in particular, it is sometimes necessary to run a program in the background, for example a system process that loads data into a database, which is then fed data by another program being run. Although RunProgram allows the stderr and stdout files to be captured, this does not seem to work when the program is run in the background. The solution may be to implement an option to run the program in a separate thread, which TSTool would continue to track. Usually the test starts the service, loads data to it, and stops the service so hopefully by the end of the test all output files are closed and complete.

Using threads can be tricky because strays will continue to run. It may be useful to implement a ThreadManager class to track all known started threads so that TSTool can present the information to users when troubleshooting.

Environment