Added pidfile writing for correct init script stopping.