If you are not on windows, you can fork, exit cleanly in one process, and exec in the other.
In reply to Re: exec with cleanup by ambrus in thread exec with cleanup by bart