Ubuntu – Several services (/etc/init.d) don’t autostart properly after scheduled reboot

cronserviceUbuntuubuntu-16.04

I use the following crontab to regularly reboot my system

30 5 * * * root root reboot

but after these scheduled reboots, some services don't automatically start. The ones I have noticed already are OpenVPN and PostgreSQL, but I expect there to be more. Firstly, I noticed this after adding the scheduled reboot but as I recently upgraded from 15.10, it could be that something went wrong during the upgrade.

I hope someone can tell me, a) what I did wrong or/and b) what may have caused this.

Best Answer

A) Daily server reboots are wrong. Other than that, the proper way to restart is shutdown -r now, which properly shuts down services on the server and then reboots.

B) Using reboot to reboot the server does not shutdown services, so those might end up in unstable state and therefore refuse to start.