You are not logged in.

#1 2014-05-23 11:26:26

Biowaste
Member
From: Denmark
Registered: 2010-06-22
Posts: 14
Website

[Solved] Execute pm-hibernate without password?

Hi Archers!

I'm trying to get pm-hibernate to execute without password.
There's a (deprecated) guide here: https://wiki.archlinux.org/index.php/pm … gular_user
...suggesting adding pm-hibernate into sudoers:

username  ALL = NOPASSWD: /usr/sbin/pm-hibernate

but it doesn't seem to work, and it also says the section is deprecated.
I know pm-suspend is now no longer necessary, because you can successfully suspend with systemctl, but pm-hibernate is still necessary to hibernate according to the wiki.
Furthermore pm-hibernate is now in /usr/bin, not sbin, which is just a symlink. So would that even work, theoretically, to reference a symlink in sudoers and not have it ask for password for what the symlink points to? It needs to be a hard link, doesn't it? Anyway I tried setting it to its hard link path instead too, and it still requested a password.
Another suggestion would be adding myself to the "power" group, maybe?, but I'm pretty sure that's deprecated with systemd too, and it's not recommended to add oneself to that group.

So my question is, how to get pm-hibernate to execute without a password these days?
Since it used to work I'm guessing it may be because something changed in relation to systemd? Maybe pm-hibernate calls something systemd-related which is now requesting the password, and not pm-hibernate itself? Or is that wrong?

Last edited by Biowaste (2014-06-06 21:10:58)

Offline

#2 2014-05-23 12:52:39

Biowaste
Member
From: Denmark
Registered: 2010-06-22
Posts: 14
Website

Re: [Solved] Execute pm-hibernate without password?

Nevermind! Found out pm-hibernate is simply also a symlink, pointing to

/usr/lib/pm-utils/bin/pm-action

So adding the following to sudoers fixed it:

username ALL=NOPASSWD: /usr/lib/pm-utils/bin/pm-action

Offline

#3 2014-05-23 14:29:39

Biowaste
Member
From: Denmark
Registered: 2010-06-22
Posts: 14
Website

Re: [Solved] Execute pm-hibernate without password?

Nevermind that nevermind. It still requires a password.

Offline

#4 2014-05-23 14:42:50

loqs
Member
Registered: 2014-03-06
Posts: 19,114

Re: [Solved] Execute pm-hibernate without password?

Do not know if this is identical to pm-hibernate but

$ systemctl hibernate

will only prompt for a password if multiple users are logged in and it is not being run as root

Offline

#5 2014-05-23 15:17:08

Biowaste
Member
From: Denmark
Registered: 2010-06-22
Posts: 14
Website

Re: [Solved] Execute pm-hibernate without password?

Well this wiki page says:

Warning: You must not use the systemd hook, because it does not support resuming from hibernation. See FS#37028 for details.

Which is why I'm using pm-hibernate.

Offline

#6 2014-05-23 15:31:27

loqs
Member
Registered: 2014-03-06
Posts: 19,114

Re: [Solved] Execute pm-hibernate without password?

Biowaste wrote:

Well this wiki page says:

Warning: You must not use the systemd hook, because it does not support resuming from hibernation. See FS#37028 for details.

Which is why I'm using pm-hibernate.

The systemd hook refers to the HOOKS line of

/etc/mkinitcpio.conf

Not the whole of systemd from the wiki page you reference if you were using the systemd hook resuming would not work at all so I assume its not in your hooks line and that bug should not occur.

Last edited by loqs (2014-05-23 15:41:19)

Offline

Board footer

Powered by FluxBB