fix shutdown running as service