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

[OpenRC] Can't shutdown or reboot after login #343

Closed
Cavernosa opened this issue Mar 15, 2022 · 5 comments · Fixed by #368
Closed

[OpenRC] Can't shutdown or reboot after login #343

Cavernosa opened this issue Mar 15, 2022 · 5 comments · Fixed by #368
Labels
bug This issue or pull request discusses a bug needs review This issue or pull request must be confirmed/reviewed

Comments

@Cavernosa
Copy link
Contributor

I'm using the OpenRC script from the ly-gentoo fork with LANG patch from here.

After login it's impossible to shutdown or reboot with loginctl poweroff command or any other poweroff command. The only way is pushing the power button, or logging out and pressing F1 or F2.

@nullgemm nullgemm added the needs review This issue or pull request must be confirmed/reviewed label Apr 25, 2022
@nullgemm
Copy link
Collaborator

nullgemm commented Apr 25, 2022

I can't test this easily and OpenRC isn't supported officially, but this issue seems to indicate something is wrong in Ly, so we should definitely investigate it. Any PRs adding OpenRC support is of course very welcome.

@nullgemm nullgemm added the bug This issue or pull request discusses a bug label Apr 25, 2022
@terrencetec
Copy link

Hi, I am seeing a possibly same problem wtih Qtile.
I am on Arch Linux, 5.17.5-arch1-1.
After logging out and logging in, I can't use the reboot and shutdown commands without root privileges.

@Cavernosa
Copy link
Contributor Author

Cavernosa commented May 12, 2022

I think i've found the issue. ly is clogging up openrc-run, because if i kill the ly process it unclogs and everything starts working as usual
This is what htop shows:

openrc default
    openrc-run /etc/init.d/ly --lockfd 15 start
        ly
            ly
                Xorg :0 vt1
                    Xorg :0 vt1
                i3

Which i'm pretty sure should have something like supervise-daemon or just ly instead of openrc-run
No idea how to fix it though

Edit: Nevermind, i just fixed the clogging problem, and that subsequently fixed the shutdown problem (and another problem where all tty's were blank) 😁
Still need to clean things up but this is the init file now:

#!/usr/bin/openrc-run

supervisor=supervise-daemon
command="/bin/agetty"
command_args_foreground="-nl /usr/bin/ly tty1 38400 linux"

name="ly"
description="TUI display manager"

depend() {
        after agetty
}

Edit 2: Turns out you just have to add -nl /usr/bin/ly to the agetty_options variable in /etc/conf.d/agetty.tty1 to make agetty run ly instead of /bin/login.
It's also possible to make a copy of the agetty init script, then add -nl /usr/bin/ly to the command args and disable the actual agetty.tty1 (look at the init script above), but it looks sketchy to me

@barunslick
Copy link

I having the same issue on Arch + bspwm. Can't seem to use the command shutdown.

@ghost
Copy link

ghost commented Oct 18, 2022

This is because X is not running on the same tty that the login occurs. ly logins user into separate tty, which messes up loginctl logind session, which inturn breaks polkit actions.

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 needs review This issue or pull request must be confirmed/reviewed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants