in reply to die; not really dying

By '*still* running' I'm assuming you mean the script that has executed the 'die'. If this is the case, I'd suspect your END block of hanging. One way to test this is to print/log the output at the beginning and end of the END block.

As UnderMine suggests, I'd suggest you use a lock file instead of trying to 'ps' the process since a lock file is automatically unlocked when a process dies. It is always possible, and I even seen cases of this, that the process you are checking has actually died and that another arbitrary process has started with the same PID.

bluto