Artix Linux Forum

Artix Linux => System => Topic started by: Samueru on 17 May 2024, 09:20:04

Title: loginctl terminate-session doesn't do anything
Post by: Samueru on 17 May 2024, 09:20:04
I'm using artix with i3wm.

I normally log out using this command in rofi:

Code: [Select]
loginctl terminate-session ${XDG_SESSION_ID-} 

This always worked on archlinux and on voidlinux as well, however on artix it doesn't work. And nothing happens when I enter the command, no error log or anything.

Yes elogind is installed, and yes the variable isn't empty, other commands like loginctl lock-session ${XDG_SESSION_ID-} do work without issues.
Title: Re: loginctl terminate-session doesn't do anything
Post by: nous on 18 May 2024, 21:54:44
Does it work in other WM/DEs?
Title: Re: loginctl terminate-session doesn't do anything
Post by: Samueru on 18 May 2024, 23:14:22

Just tried it in hyprland, didn't work either.

Worth mentioning that I log in thru tty, but then again this didn't happen on voidlinux and I used the same method to login there.

I also had an issue that running `loginctl reboot --firmware-setup` asked for my sudo password thru polkit, that was because the wheel group wasn't being allowed run any command in sudoers, so I don't know if this is also a permission issue.

Title: Re: loginctl terminate-session doesn't do anything
Post by: hyuga on 19 May 2024, 00:14:23
With all the window managers I am using I just just run the following command:

Code: [Select]
pkill dwm

It's short and to the point.
Title: Re: loginctl terminate-session doesn't do anything
Post by: Samueru on 21 May 2024, 05:10:01
With all the window managers I am using I just just run the following command:

Code: [Select]
pkill dwm

It's short and to the point.

I can logout using i3-msg exit, I didn't want to use that method as it is less universal than the loginctl method, which even used to work on systemd distros.

I began doing it and now I discovered a bigger issue. If I run i3-msg exit i3 does logout, however once I log back in, I cannot start i3 again. I have to reboot the PC. Trying to start i3 after logging out leads to a can't open display error.

(https://i.imgur.com/ZzSvAIH.png)
 
EDIT: Turns out this issue that I can't start i3 again was caused by the user processes not being killed on logout. I added `KillUserProcesses=yes` to /etc/logind.conf hoping that it would fix that but didn't still, now I guess I will have to make a script that kills them on exit.

Title: Re: loginctl terminate-session doesn't do anything
Post by: cds on 21 May 2024, 12:23:05
Since you appear to not be using a login manager, and when you logout as you do, you are effectively killing off X.
Try running looking at your your .xinitrc file for a hint, or simply use startx
Title: Re: loginctl terminate-session doesn't do anything
Post by: Samueru on 22 May 2024, 11:05:16
Since you appear to not be using a login manager, and when you logout as you do, you are effectively killing off X.
Try running looking at your your .xinitrc file for a hint, or simply use startx

I use startx already: https://github.com/Samueru-sama/dotfiles/blob/main/.local/config/X11/xinitrc

And zshrc and zprofile: https://github.com/Samueru-sama/dotfiles/blob/main/.local/config/zsh/.zshrc
https://github.com/Samueru-sama/dotfiles/blob/main/.local/config/zsh/.zprofile


And the rofi script that I am using: https://github.com/Samueru-sama/dotfiles/blob/main/.local/scripts/rofi/rofi-power-menu.sh
https://github.com/Samueru-sama/dotfiles/blob/main/.local/scripts/i3/fixlogout.sh

Something worth mentioning, is that before on voidlinux I used to have a weird bug that when logging out tty would freeze (all ttys) and I could not use the computer until I forced a reset, this bug was something that I got other people to replicate.

So to fix that bug I basically just ran i3-msg exit first and then the loginctl terminate-session to actually logout.

On artix something different happens, when I do i3-msg exit it logs me out as well and the last part of the fixlogout script is useless basically.