LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 09-07-2023, 04:42 PM   #1
drigohighlander
LQ Newbie
 
Registered: Mar 2012
Posts: 29

Rep: Reputation: Disabled
loginctl shows tty instead x11


Hi folks
When I startx my xfce4 desktop from command line (I'm using Slackware-Current)
loginct shows tty.

loginctl show-session 1 --p Type --value
tty

But when I use one display manager, like xdm or sddm for example, it shows
correctly x11

loginctl show-session 1 --p Type --value
x11

The problem is, anydesk and other applications only works in Xorg, and they check this type if is x11 to work, so I can only use these softwares using a display manager (xdm or sddm for example).

But I can't use these displayer manager, because I need autologin, and xdm doens't have it, and sddm has so many dependences to work on for my little server.

Has anyone came into this problem too? how startx xfce4 or other environment with the correctly loginctl session type?

Thanks all in advance.

Last edited by drigohighlander; 09-07-2023 at 04:44 PM.
 
Old 09-08-2023, 10:19 AM   #2
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,659

Rep: Reputation: 2583Reputation: 2583Reputation: 2583Reputation: 2583Reputation: 2583Reputation: 2583Reputation: 2583Reputation: 2583Reputation: 2583Reputation: 2583Reputation: 2583

(Disclaimer: I don't use Slackware and know very little about elogind, but in the absence of other answers...)

Assuming Slackware uses a sufficiently same elogind as in Debian, the relevant logic seems to be in pam_sm_open_session in pam_elogind.c

It looks like if XDG_SESSSION_TYPE is populated, its value will be used, otherwise it is derived from other variables:
Code:
type = getenv_harder(handle, "XDG_SESSION_TYPE", type_pam);

...

if (isempty(type))
   type = !isempty(display) ? "x11" :
      !isempty(tty) ? "tty" : "unspecified";
So if "XDG_SESSSION_TYPE=x11; loginctl ..." gives the desired output, you probably just need to export that variable in an appropriate place.

 
Old 09-08-2023, 02:30 PM   #3
drigohighlander
LQ Newbie
 
Registered: Mar 2012
Posts: 29

Original Poster
Rep: Reputation: Disabled
Hi, It worked! ..but..

First of all setting XDG_SESSION_TYPE before login (/etc/rc.d/rc.local) or after that (and ran startx), didn't work.
What worked was setting this variable in /etc/environment, but all my logins shows Type=x11 even when I didn't start X yet
So it's not the ideal solution.

I managed to skip the login part, and go right through the X and xfce4, so I manually ran the profile scripts, but loginctl shows 'no sessions' now, it's like I didn't have logged in the system (right.) but I didn't manage how to run the same login shell after boot in the terminal.

su doens't work, loginctl still shows no sessions.

So ok, it worked, but it's not a ideal fix.
Thank you for all your help.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Slackware-current: is possible to run loginctl hibernate as user? camerabambai Slackware 12 07-01-2021 06:19 PM
Acpi loginctl and power management hell Tonus Slackware 5 03-16-2021 02:53 PM
hanging session in systemd loginctl jleonardi Linux - Server 2 01-04-2018 07:48 PM
[SOLVED] /usr/bin/X11/X11/....... 10 X11 subsets & counting walter74 Linux - General 2 06-07-2015 12:36 AM
change tty => system crashes (ati driver/tty resolution) mosca Debian 6 08-05-2004 07:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 07:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration