在 Ubuntu 16.04 上重新启动并关闭 'destructive'

Reboot and poweroff 'destructive' on Ubuntu 16.04

当我尝试重新启动或关闭笔记本电脑时,它不起作用。进一步调查后:

$ 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)

重新启动已禁用。但是,尝试使用 systemctl enable reboot.target 启用它会导致以下输出: Failed to execute operation: File exists

在运行reboot之后,我得到以下错误:

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

我不知道该怎么办;现在我只是强制关机,但我希望每次关机时都可以使用重启和关机功能而无需切断电源。

man systemctl 中所述,"enabling" 服务通常意味着您希望它在启动时 运行。如果启用了 "reboot" 目标,您将指示笔记本电脑在启动过程中重新启动。这可能不是你想要的。

/etc/systemd/journald.conf中设置Storage=persistent

然后:

 systemctl daemon-reload

下一次失败后 sudo reboot,请检查您的 systemd 日志文件的内容,看看您是否能找到在关机期间挂起的东西。