Stop a service, run your maintenance command, start it again. The restart lives in a finally block and fetches its own fresh token, so it fires even when the command exits non-zero, raises, cannot ...