I'm tyring to close or restart my Kubuntu 16.04 both from UI and CLI.
For CLI I'm using
sudo shutdown -r now
shutdown -P now
For both above cases and from the UI sometimes my desktop computer freezes with X session terminated and shell screen with login prompt visible. Problem is that I'm not able to log in and the system does not restart or shutdown. This happens from time to time. However I need my OS to close and restart reliably. What can I do?