Hello,
I am sure this info is somewhere on the web but have not been able to find it via google or by searching this site. On HPUX we have a model script that runs a command to capture the spool file to a repository and doesn't actually physically print the spool file. This has been working fine for many years.
Today we found a strange quirk. If the print queue is disabled, the model script stops executing as expected but if the capture command is running, it continues to run until it completes. The return code from the capture command is not passed back to the model script (or the model script ignores it because it has been disabled). When the queue is enabled again, the job that was running when the queue was disabled is processed again. The lpsched man page (lpsched 1M on HP) mentions this behavior and this is the behavior I would expect from lpsched. The problem is the same spool file is being completely processed twice causing duplication in our repository.
So here comes the question. Does anyone know anyway I can send SIGTERM/SIGKILL/etc to the capture command when the queue is disabled by placing code in the same model script? In my case it would be approriate to kill the capture command if the queue is disabled. If this is not possible, how about the inverse - passing the success of the capture command back to model script thus completing the job so lpsched starts with the next job when the queue is enabled once again.
During some of my testing to figure this out, I have noticed that once a queue is disabled, any commands running from that model script seem to lose STDOUT and STDERR. Can anyone confirm this? I am doing more testing to see if I can prove otherwise.
Thanks,
TioTony