Publish events on startup and shutdown