“systemctl suspend-then-hibernate”无需 root 权限

“systemctl suspend-then-hibernate”无需 root 权限

我想将此命令“systemctl suspend-then-hibernate”添加到组合键(ALT+s)。由于某些未知原因,它会请求权限,但不要求“systemctl hibernate”或“systemctl suspend”。可能是什么原因?我还检查了 sudoers。添加它没有帮助。我不确定这些命令如何运行 - 在 /etc 路径中找不到任何东西。有人能给我提示吗?在最好的情况下,我会在 powermanager 中用这个“suspend-then-hibernate”替换“suspend”,相当于 close-lid。谢谢(运行 ubuntu mate 18.04)

答案1

可以回答第一部分:/etc/sudoers 中的添加是错误的。我不清楚其中的区别,但将这一行添加到 /etc/sudoers.d/myfile 有帮助。

如何用挂起然后休眠来取代默认挂起的问题仍然悬而未决。

相关内容