[SOLVED] Slackware-current: is possible to run loginctl hibernate as user?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Slackware-current: is possible to run loginctl hibernate as user?
I'm on Slackware current usingd elogind, I can sleep and hibernate only using sudo from terminal.
With the old good pm-utils I had only to edit the 10-enable-suspend.rules, make init 3 && init 4 and I can hibernate as user.
Now I make those steps
I can "loginctl hibernate" from within a KDE Plasma5 session, as normal user, and it takes only a few seconds to complete. After restarting the laptop and loading the hibernation image from disk, I am right back where I started the hibernation. No sudo needed for this.
If you created your user from The adduser script then your user is in the Power group gives him rights.
for Hibernate I set up a in lilo and or grub2 resume=/dev/sda4 that is my swap partition.
Not sure if that is needed anymore but I still use it for hibernate.
Sleep gets saved to ram. system stays on.
Hibernate
During hibernate the system is fully powered off, and system state is saved to disk.
The system does not require power, and can stay in hibernate mode indefinitely.
Most modern systems require 15 to 45 seconds to enter and leave hibernate, and entering and
leaving hibernate takes longer when you have more memory.
Hybrid-Hibernate
Hybrid-suspend is the process where the system does everything it needs to hibernate, suspends instead of shutting down.
This means that your computer can wake up quicker than for normal hibernation if you do not run out of power, and
you can resume even if you run out of power
If you created your user from The adduser script then your user is in the Power group gives him rights.
for Hibernate I set up a in lilo and or grub2 resume=/dev/sda4 that is my swap partition.
Not sure if that is needed anymore but I still use it for hibernate.
Sleep gets saved to ram. system stays on.
Hibernate
During hibernate the system is fully powered off, and system state is saved to disk.
The system does not require power, and can stay in hibernate mode indefinitely.
Most modern systems require 15 to 45 seconds to enter and leave hibernate, and entering and
leaving hibernate takes longer when you have more memory.
Hybrid-Hibernate
Hybrid-suspend is the process where the system does everything it needs to hibernate, suspends instead of shutting down.
This means that your computer can wake up quicker than for normal hibernation if you do not run out of power, and
you can resume even if you run out of power
my hibernation work, but only as root
my problem is, that I want to hibernate from user
Code:
groups |grep --color power
wheel floppy audio video cdrom games plugdev power netdev scanner users kvm vdr
loginctl hibernate
echo $?
1
syslog said..
Code:
loginctl[2419]: Failed to hibernate system via elogind: Interactive authentication required.
Last edited by camerabambai; 06-21-2021 at 08:13 PM.
Please check if your user is listed in the power group ?
If not you should add your user to the power group in /etc/group .
I can confirm that my system suspends when I do "loginctl suspend" as user, but it does not return back very well,
it powers up but nothing shows on the screen.
Please check if your user is listed in the power group ?
If not you should add your user to the power group in /etc/group .
I can confirm that my system suspends when I do "loginctl suspend" as user, but it does not return back very well,
it powers up but nothing shows on the screen.
Then you need to tell the kernel where to look for resume append lilo or grub resume=/dev/sdX your swap partition.
with multiple drives and operating systems at lilo or grub must log back to the one you hibernated from.
I think that for suspend to ram should not be needed. Only to hibernate. In any case I have resume=/dev/sda1 in my append in lilo.conf, but the thing is that it does not even start lilo, it comes directly into the console, but most probably my problem is with the X desktop
I am running. On kernel side it seems to work fine as I can CTRL-ALT-DEL when it comes back, but I can not ssh into it.
I think that for suspend to ram should not be needed. Only to hibernate. In any case I have resume=/dev/sda1 in my append in lilo.conf, but the thing is that it does not even start lilo, it comes directly into the console, but most probably my problem is with the X desktop
I am running. On kernel side it seems to work fine as I can CTRL-ALT-DEL when it comes back, but I can not ssh into it.
You're correct, the resume thing is only used for hibernate. And suspend is notoriously unreliable because it depends on PC BIOS/UEFI and ACPI and that's all such buggy junk, but sometimes you just get lucky and it works.
I don't have swap on this system so can't test hibernate but 'loginctl reboot' works so there's no permission problem. Curiously 'loginctl suspend' just crashes my system (as does writing to /sys/power/state[1]) but i've been using the the xfce 'suspend' action menu just fine since I got it setup 18 months ago. I have no idea why it behaves differently since they both seem to just use dbus to initiate the suspend.
I use xdm @ runlevel 4 to login, use xfce4, elogind is using defaults, and I never mucked about with polkit stuff. My user is not in the power group.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.