Moving service running check to after config file writing