Fixes #4976 - ensure the process is really running inside a rake task