Autostart service and save cache on shutdown