Search code examples
ubuntu-16.04systemdrebootsystemctl

Reboot and poweroff 'destructive' on Ubuntu 16.04


When I try to reboot or turn off my laptop, it doesn't work. After investigating a little further:

$ systemctl status reboot.target
● reboot.target - Reboot
   Loaded: loaded (/lib/systemd/system/reboot.target; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:systemd.special(7)

reboot is disabled. However, trying to enable it with systemctl enable reboot.target results in this output: Failed to execute operation: File exists

After running reboot, I get the following error:

Failed to start reboot.target: Transaction is destructive.
See system logs and 'systemctl status reboot.target' for details.

I have no idea what to do; for now I'll just force poweroff, but I'd like to be able to use the reboot and shutdown functionality without cutting power every time I want to turn it off.


Solution

  • As documented in man systemctl, "enabling" a service typically means that you want it to run at boot. If the "reboot" target was enabled, you would be instructing your laptop to be rebooted as part of the boot process. That's probably not what you want.

    In /etc/systemd/journald.conf, set Storage=persistent.

    Then:

     systemctl daemon-reload
    

    After your next failed sudo reboot, check the contents of your systemd journal file to see if you can find something hanging during shutdown.