Fixed init scripts to wait for shutdown on restart