write pid and trigger restart via cron