Skip to main content
Topic: loginctl terminate-session doesn't do anything (Read 558 times) previous topic - next topic
0 Members and 4 Guests are viewing this topic.

loginctl terminate-session doesn't do anything

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.

 

Re: loginctl terminate-session doesn't do anything

Reply #2

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.


Re: loginctl terminate-session doesn't do anything

Reply #3
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.

Re: loginctl terminate-session doesn't do anything

Reply #4
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.


 
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.


Re: loginctl terminate-session doesn't do anything

Reply #5
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
Supercalifragilisticexpialidocious

Re: loginctl terminate-session doesn't do anything

Reply #6
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.