Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resuming after loginctl suspend or closing/reopening laptop lid #663

Open
1 task done
NuLL3rr0r opened this issue Jul 28, 2024 · 3 comments
Open
1 task done

Resuming after loginctl suspend or closing/reopening laptop lid #663

NuLL3rr0r opened this issue Jul 28, 2024 · 3 comments
Labels
bug This issue or pull request discusses a bug

Comments

@NuLL3rr0r
Copy link

Pre-requisites

  • I have looked for any other duplicate issues

Ly version

Ly version 1.0.1

Observed behavior

When invoking:

$ loginctl suspend

Or, by closing the laptop lid the system goes to suspend, which is expected. But, as soon as I reopen the lid, even though the laptop keyboard and power LED turn on, I see the display is blank, pressing Ctrl+Alt+F1 won't go to TTY1 either.

I SSH from another machine and can check the lid and loginctl status as well:

$ cat /proc/acpi/button/lid/LID0/state 
state:      open

$ loginctl session-status
4 - mamadou (1000)
           Since: Sun 2024-07-28 18:59:30 CEST; 1min 19s ago
          Leader: 15256 (sshd-session)
          Remote: 192.168.2.140
         Service: sshd; type tty; class user
           State: active

$ loginctl list
SESSION  UID USER    SEAT  TTY 
      3 1000 mamadou seat0 tty2
      4 1000 mamadou       

2 sessions listed.

$ loginctl list-users
 UID USER    LINGER
1000 mamadou no

1 users listed.

$ loginctl user-status mamadou
mamadou (1000)
           Since: Sun 2024-07-28 18:57:15 CEST; 5min ago
           State: active
        Sessions: 4 *3
          Linger: no
            Unit: user-1000.slice

I'm on Gentoo using OpenRC.

Expected behavior

The laptop should resume working where I left off in order to preserve the current session, especially since SDDM works perfectly fine on this laptop.

Steps to reproduce

  1. Close the lid or loginctl suspend.
  2. Reopen the lid.

Relevant logs

No response

@NuLL3rr0r NuLL3rr0r added the bug This issue or pull request discusses a bug label Jul 28, 2024
@AnErrupTion
Copy link
Collaborator

@NuLL3rr0r Does using s2ram as root work? If so, try to do the following:

Open the file /etc/pam.d/ly, and add the following line right after #%PAM-1.0:

-session   optional     pam_elogind.so

Reboot, and try to use loginctl suspend again.

@NuLL3rr0r
Copy link
Author

Thank you for the suggestion. I tried s2ram, but it refused to work since it could not detect the hardware:

$ s2ram        
Machine is unknown.
This machine can be identified by:
    sys_vendor   = ""
    sys_product  = ""
    sys_version  = ""
    bios_version = ""

But, s2ram -f works. It suspends and resumes successfully.

I tried your suggestion, but still loginctl suspend or closing the lid and reopening it gives me a blank screen.

$ cat /etc/pam.d/ly 
#%PAM-1.0

session   optional     pam_elogind.so

auth       include      login
account    include      login
password   include      login
session    include      login

I tried this with the - as well but did not work either:

$ cat /etc/pam.d/ly 
#%PAM-1.0

-session   optional     pam_elogind.so

auth       include      login
account    include      login
password   include      login
session    include      login

@NuLL3rr0r
Copy link
Author

NuLL3rr0r commented Jul 30, 2024

Interesting, I did a bit more experiments. If I add that session line to /etc/pam.d/ly it breaks s2ram as well. But, another experiment when I do s2ram -f if I don't close the lid it's able to wake up. If I close the lid and reopen it, I don't get the exact same blank screen, this time the cursor is visible but everything is black. Even if I switch my i3wm workspaces to my terminal workspace or the web browser workspace, I see the cursor changes accordingly but nothing is visible and black, until I press the power button, then for a fraction of a second, I see my desktop wallpaper before switching to tty1 for shutdown. Without s2ram I don't see anything until it switches to tty1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue or pull request discusses a bug
Projects
None yet
Development

No branches or pull requests

2 participants