We are sometimes having an issue with a script (ksh) that we run to stop a thread that is writing to a file, doing something with that file including moving it, and then starting the thread back up for the next day’s processing. What is happening is that the pstop command is issued, the file processing is done, the pstart command is issued, then the pstop command is finally processed by the engine. This leaves the thread not running for the next day’s process and the file not generated.
My question – besides putting in a sleep command after the pstop (5 seconds would do it), is there a way to have the script wait until the command has been processed?
I thought of writing a TCL script that does the stop and then doesn’t return control until the command has been processed (and throw a time limit in to keep infinite loops away), determined by looking at the thread status.
Thanks,
Paul Bishop
Carle Foundation Hospital
Urbana, IL