Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to configure xdm to not show a login prompt?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
mi_unixbird
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jul 2015
Posts: 118

PostPosted: Tue Jul 28, 2015 6:46 am    Post subject: How to configure xdm to not show a login prompt? Reply with quote

Fairly weird situation that leads me to not being able to just not start xdm, in fact, xdm is not in my runlevels, it's just required by the bumblebee daemon, god knows why but it is. So whenever that starts at boot it starts the xdm login screen while I just want to be taken straight to VT1.

The login screen is also not operational by the way, logging into it does nothing.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9646
Location: almost Mile High in the USA

PostPosted: Tue Jul 28, 2015 11:38 pm    Post subject: Reply with quote

Reference: https://forums.gentoo.org/viewtopic-t-1024642-highlight-.html

xdm was mean to display a login prompt - that's what it's there for. If it's run and successful, it gives you a login prompt.

So two things:
1) obvious: stop running xdm - hack the init files to stop requiring xdm
2) hack: remove xdm so that it will not run.
3) hack: make xdm fail every time
4) option: make xdm work properly.

I think you should go for option 4. I used to use text logins for my laptops and computers but they've gotten fast enough that I just run another display manager (lightdm, slim, and for a short while xdm).

Most of the times when xdm fails to log you in is that your system isn't configured for a proper X session or it fell through all the defaults.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Wed Jul 29, 2015 1:21 am    Post subject: Reply with quote

Look for files named Xorg.0.log and xdm.log in /var/log for clues.

Regarding autologin, I don't know but I used to autologin in Gnome2 using gdm which is derived from xdm, so there must be a way with a little hacking.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9646
Location: almost Mile High in the USA

PostPosted: Wed Jul 29, 2015 5:23 am    Post subject: Reply with quote

It's probably more likely some .xsession-errors file in your home directory that has the log for failing xdm login.

From what I can take, it seems mi_unixbird wants to maintain text login... This might be the thing we're fighting against.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
mi_unixbird
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jul 2015
Posts: 118

PostPosted: Wed Jul 29, 2015 6:21 am    Post subject: Reply with quote

eccerr0r wrote:
Reference: https://forums.gentoo.org/viewtopic-t-1024642-highlight-.html

xdm was mean to display a login prompt - that's what it's there for. If it's run and successful, it gives you a login prompt.
This makes it even more confusing to me, why would virtualgl requie a login manager, what could possibly be this purpose, especially because it doesn't actually list xdm as dependency.

So two things:
1) obvious: stop running xdm - hack the init files to stop requiring xdm[/quote]tried it, removing the 'need xdm' part from the init scripts makes virtualgl require it. Without xdm starting, I get an "xauth: file list does not exist" error and virtualgl won't start.
Quote:
2) hack: remove xdm so that it will not run.
3) hack: make xdm fail every time
Tried replacing xdm with a dummy executable that immediately exists, same scenario applies.
Quote:
4) option: make xdm work properly.
That would defeat the excersize though, it's still less effort to just first press ctrl+alt+f1 to log in and accept having the actual window manager exist at DISPLAY=:1

But I'm going to try to install virtualgl from the bumblebee live overlay. Right now it doesn't install with a weird error of sed not seeing a certain file so I hope it's just a temporary mixup by the maintainer and it'll eventually work.
Back to top
View user's profile Send private message
mi_unixbird
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jul 2015
Posts: 118

PostPosted: Wed Jul 29, 2015 6:49 am    Post subject: Reply with quote

Okay, so I hacked together an extremely crude temporary fix which relies on that I'm the only user on this machine, I probably need to revisit it in the future:


/etc/init.d/vgl:
Code:

#!/sbin/runscript
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/x11-misc/virtualgl/files/vgl.initd-r2,v 1.1 2013/05/26 18:46:27 pacho Exp $

# TODO: description="*" and other OpenRC 0.9+ candies

depend() {
   ### probably a supremely bad idea ###
   #need xdm
   after sshd
}

start() {
   ebegin "Starting VirtualGL"
   truncate --size=0 /var/lib/VirtualGL/vgl_xauth_key
   
   ### the crudest of hacks, needs later fixing ###
   XAUTHORITY=/home/laj/.Xauthority
   # Check if XAUTHORITY was set successfully, if not wait a bit and let X to start
   [ -z "$XAUTHORITY" ] && sleep 3 && set_xauth
   [ -e "$XAUTHORITY" ] || sleep 3
   xauth -f /var/lib/VirtualGL/vgl_xauth_key add $DISPLAY . `xauth -f $XAUTHORITY list | awk '{print $3;exit}'` && \
      chmod 644 /var/lib/VirtualGL/vgl_xauth_key
   eend $?
}

stop() {
   ebegin "Stopping VirtualGL"
   [ -f /var/lib/VirtualGL/vgl_xauth_key ] && \
      rm /var/lib/VirtualGL/vgl_xauth_key
   eend $?
}


The parts below the two "###" parts are relevant, I commented out the "need" part and manually set XAUTHORITY to the .Xauthority file in my home dir which allows vgl to start without issues it seems. Seems that xdm was needed only to set that file. Thusfar it seems to run without any issues to it. optirunning a game seems to work fine and without issue.

A possible future more robust fix may involve reverting the changes and outputting the value it obtains from XAUTHORITY, one assumes xdm sets that, and see if the file exists even if xdm did not start.
Back to top
View user's profile Send private message
mi_unixbird
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jul 2015
Posts: 118

PostPosted: Wed Jul 29, 2015 7:57 am    Post subject: Reply with quote

For future reference, if someone as perplexed as I encounters the same problem, after some experimental hacking in /etc/init.d/vgl I found out that this whole xauth thing is in fact unneeded which makes me wonder what the purpose is.

My current /etc/init.d/vgl simply looks like this:

Code:
#!/sbin/runscript
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/x11-misc/virtualgl/files/vgl.initd-r2,v 1.1 2013/05/26 18:46:27 pacho Exp $

# TODO: description="*" and other OpenRC 0.9+ candies

depend() {
   ### probably a supremely bad idea ###
   # need xdm
   after sshd
}

start() {
   ebegin "Starting VirtualGL"
   ### the crudest of hacks, needs later fixing ###
   # truncate --size=0 /var/lib/VirtualGL/vgl_xauth_key
      
   
   # Check if XAUTHORITY was set successfully, if not wait a bit and let X to start
   # [ -z "$XAUTHORITY" ] && sleep 3 && set_xauth
   # [ -e "$XAUTHORITY" ] || sleep 3
   #xauth -f /var/lib/VirtualGL/vgl_xauth_key add $DISPLAY . `xauth -f $XAUTHORITY list | awk '{print $3;exit}'` && \
      #chmod 644 /var/lib/VirtualGL/vgl_xauth_key
   eend $?
}

stop() {
   ebegin "Stopping VirtualGL"
   [ -f /var/lib/VirtualGL/vgl_xauth_key ] && \
      rm /var/lib/VirtualGL/vgl_xauth_key
   eend $?
}


I must admit, I am confused what it all is for.
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Wed Jul 29, 2015 12:57 pm    Post subject: Reply with quote

I'm confused too. I didn't even know what bumblebee was and still aren't sure. From the bumblebee wiki:

Quote:

Most defaults are set to sane values known to work but they can be tweaked for better performance.

VGL preferences (see also User's Guide for VirtualGL: 19 Advanced configuration)
VglTransport sets the compression method for framestransport possible values: yuv, jpeg, proxy (VGL default), xv, rgb
The setting VirtualDisplay selects the X display to be used (this display is started by Bumblebee)


Yet you want to run this without X? Or just without xdm, i.e using some other manager or startx? It seems to me like wanting to run mplayer without a manager.

If you are using slim or lxde just substitute that in place of xdm in the init script.

I've never seen anyone use a laptop without a GUI before. Probably the bumblebee developers hadn't either.
Back to top
View user's profile Send private message
mi_unixbird
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jul 2015
Posts: 118

PostPosted: Wed Jul 29, 2015 1:25 pm    Post subject: Reply with quote

Tony0945 wrote:
I'm confused too. I didn't even know what bumblebee was and still aren't sure. From the bumblebee wiki:
If your notebook has an nvidia graphics card an integrated graphics Bumblebee is a solution that allows you to run most things on the less power consuming integrated graphics card but some demanding things like videogames on the nvidia card. There are other ways like just letting the nvidia driver switch automatically or manually activating the card for everything. Basically Bumblebee introduces the 'optirun' command, anything ran with optirun as a process uses the nvidia card instead of the integrated one. I find this the most elegant solution since it uses the card on a per-process thing instead of switching the entire thing.

To do this it needs two daemons running, bumblebeed and vgld.

Quote:

Yet you want to run this without X? Or just without xdm, i.e using some other manager or startx?
Yeah, just startx. I have an irrational hatred to stuff starting automatically that I may or may not need.

Quote:
I've never seen anyone use a laptop without a GUI before. Probably the bumblebee developers hadn't either.


Well, I have a GUI. Before I fixed it though with the hack above I needed to start vgld before loading an X, this would load an xdm display manager on VT7/DISPLAY=:0. THen I had to go back to VT1 and execute startx to load my default fluxbox on VT8/DISPLAY=:1. This had to be done in that order. If Fluxbox was already on VT7/DISPLAY=:0 and I then started or restarted vgld it would not properly start any more. Really annoything if you can reload the daemon without first exiting fluxbox and all your applications.

But I hacked a fix now. And I'm not sure why it's needed. On debian it never required a graphical display when it installed from the package manager. I could just type `service bumlebeed start` and it would start without automatically running xdm or whatever and I could then startx. Or I could first startx and then start bumblebeed after X was already on. Just as I can now just by commenting out lines of code in the xinit. It asks for an xauth token in the init script but when I comment out that whole business it just seems tos tart, business as usual and I haven't encountered any problems yet with it, really weird.
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Wed Jul 29, 2015 2:28 pm    Post subject: Reply with quote

mi_unixbird wrote:
Yeah, just startx. I have an irrational hatred to stuff starting automatically that I may or may not need.


It's your machine, but I think it's a security hole. Startx is basically for setting up X.
Back to top
View user's profile Send private message
mi_unixbird
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jul 2015
Posts: 118

PostPosted: Wed Jul 29, 2015 2:45 pm    Post subject: Reply with quote

Tony0945 wrote:
mi_unixbird wrote:
Yeah, just startx. I have an irrational hatred to stuff starting automatically that I may or may not need.


It's your machine, but I think it's a security hole. Startx is basically for setting up X.
How? Startx is just a wrapper around xinit. It starts an X session and and then executes a program in that server.

I'm not sure how it's going to be a hole, I mean the program is going to exist on your computer and can be ran without root rights, it automatically comes with installing xorg.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9646
Location: almost Mile High in the USA

PostPosted: Wed Jul 29, 2015 5:51 pm    Post subject: Reply with quote

The underlying problem here is that bumblebee (some nvidia program that mucks with graphics card settings) wants X11 to be running.
If you don't have X11 running with nvidia graphics, it's not happy hence the "needs" requirement - it actually does not need xdm started, rather it wants X11 started and xdm is the cleanest way to start X11 without requiring someone to log in. Starting X manually does not meet the "needs" requirement unless you startx before OpenRC starts bumblebee, which is a bit hard to do.

Basically the hacks you did was ... uninstall and not use the programs that fail because X isn't started up.

So the correct solution indeed is to use xdm/graphical login if you don't want to hack anything, especially if you don't understand what you're hacking.

Or you have to go complain to Nvidia that you want to use their software your way and not the way they envision it... Now they will manually have to poll whether you're in X or not to start.

Else you should just remove these two from your startup scripts (rc-update delete bumblebee default, etc.), and make a sudo script to run these after you login and after you startx. You still need to hack them to not start xdm.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
mi_unixbird
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jul 2015
Posts: 118

PostPosted: Wed Jul 29, 2015 6:43 pm    Post subject: Reply with quote

eccerr0r wrote:
The underlying problem here is that bumblebee (some nvidia program that mucks with graphics card settings) wants X11 to be running.
If you don't have X11 running with nvidia graphics, it's not happy hence the "needs" requirement - it actually does not need xdm started, rather it wants X11 started and xdm is the cleanest way to start X11 without requiring someone to log in.
I respectfully disagree that this is needed because the very same software on Debian does not need it. Furthermore, I can start the bumblebee daemon without X running on debian cleanly without a hack and I can start it after X is running and I can restart it at my pleasure.

For some reason, it needs whatever xauth is doing on Gentoo, or does not need it, I don't know, I can't exactly find out what xauth does and what Xauthority files do, they seem to be related to permissions but I'm not quite sure what. Thusfar everything seems to work. I am sceptical that bumblebee, or rather virtualgl needs X to run or that at least it cannot be patched in a way that it doesn't need it because it doesn't need it on other systems.

Quote:
Starting X manually does not meet the "needs" requirement unless you startx before OpenRC starts bumblebee, which is a bit hard to do.
There is no need for bumblebeed to be in the init's runlevels at all. It can be started at any point. In fact, under the old system, first starting X and then starting bumblebeed broke with similar errors to removing xdm altogether. It starts xdm on another display and then again produces the same xauth error.

Quote:
Basically the hacks you did was ... uninstall and not use the programs that fail because X isn't started up.
I disagree, what I did is uninstall and not use the programs that I didn't want to use and to my surprise discover that thusfar everything goes fine without them. xdm never failed, it started correctly.

Quote:
So the correct solution indeed is to use xdm/graphical login if you don't want to hack anything, especially if you don't understand what you're hacking.
It is the solution they intend yes, and while I concede that hacking what you don't fully understand is dangerous. I retain that given the evidence that xdm nor x is needed to start it on other distros, it cannot be fundamentally needed. I would go so far as to suspect that the inclusion of xdm in this case is a result not of the bumblebee team but of whoever packaged it for Gentoo making an innocent error. I do find it possible. I googled around and all the error messages I got happened only on Gentoo.

Quote:
Or you have to go complain to Nvidia that you want to use their software your way and not the way they envision it... Now they will manually have to poll whether you're in X or not to start.
Bumblee and virtualgl are not made by nvidia, they are FOSS projects that simply enable the switching between intel integrated graphics cards and nvidia drivers for a single process. Nvidia does not as much as acknlowedge the project and feels you should use their solutions "Optimus" or "Nvidia-prime" which I don't like because they switch the entire X server over to a different card rather than a single process and its children.

Quote:
Else you should just remove these two from your startup scripts (rc-update delete bumblebee default, etc.), and make a sudo script to run these after you login and after you startx. You still need to hack them to not start xdm.
See above, if you do that it will still complain. Its major issue is that the XAUTHORITY variable doesn't seem to be set. If I do "# XAUTHORITY=~.Xauthority service bumblebee start" then it does work again on my default Window manager, it just needs that variable to point to whatever valid Xauthority file, it then creates a file based on it in /var/lib/VirtualGL/vgl_xauth_key. I'm not sure where htat file is needed for, it might be remote access authorization, the file is currently not there and bumblebee seems to run fine without it. But maybe it now cannot X tunnel.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9646
Location: almost Mile High in the USA

PostPosted: Wed Jul 29, 2015 6:57 pm    Post subject: Reply with quote

OK then go file a bug on bugs.gentoo.org. Congratulations you found a "bug".

Or just "xhost +" if you don't understand xauthority... It bypasses xauthority and everything else.

<<end transmission and unsubscribing>>
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum