Execute a command when another process is ended