Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Auto login and startx(desktop) without a display manager.

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Message
Author
User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Auto login and startx(desktop) without a display manager

#21 Post by Head_on_a_Stick »

CwF wrote:how does one log off

Code: Select all

# systemctl stop getty@ttyX
Replace X with the TTY number from which you wish to log off.
deadbang

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: Auto login and startx(desktop) without a display manager

#22 Post by Deb-fan »

^ Thanks Hoasinator ... At this point I still really don't understand what's even going on here anyway. :D

@CwF ... I thought you were doing something like that, some of your nix-wizardry. Running apps or whatever else in a bunch of the tty's. Nothing at all wrong with that either and it sounds interesting + cool. Am about 110% certain there's MANY ways to address it, make things work smoothly, outside of the one Head_on was nice enough to provide already. It's gnu/Linux when isn't there many ways to do just about anything and everything ? :P Other than all this babbling/droning I don't have much of value to offer about the issue. Am mentally worn out right now so going to fallback to watching a movie. No way I'd even try to replicate the kind of setup you describe, it sounds involved setting such a configuration up.

Would be curious, if it's easily possible for you to employ Head_on's method, the approach he posted for this and see if it acts the same way. Really what he posted seems more proper and clean anyway. Only getting the feeling it has nothing to do with autologin/startx without a display manager, more that the issue lay somewhere else, something to do with configuration or the way things are setup. For some more groundless (and probably incorrrect) speculation maybe even a systemd bug, what version is involved here ? The thing is apparently now responsible for setting up VT's to a great extent, thus should play a keyrole in tearing them down too. Such as when a user wants to logout of one of them. DAMMIT, again ... that's just rampant speculation. I really like systemd personally anyway.

Did I ever mention I tend to wayyyyy overthink chit ? :D Just too many things which could be, might be, blahblahblah. Only way to really know would be hands on and take much time for something that sounds like it's not all that big a deal or real problem for you anyway. Alright, movie time.
Most powerful FREE tech-support tool on the planet * HERE. *

CwF
Global Moderator
Global Moderator
Posts: 2636
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 192 times

Re: Auto login and startx(desktop) without a display manager

#23 Post by CwF »

Head_on_a_Stick wrote:# systemctl
Thanks for the input, but clarify if that logs off or kills (as in crashes) that desktop, since I would be in another tty and that desktop is not logged off.

'#' is not possible on this desktop by intention. So me coming along later and using my authority to kill the unused desktop is not the use case.

I'd like the instruction to be to key into this tty and it's self explanatory, do what you will, log out - and please key back to ttyx. Somewhat analogous to please put the seat down when you're done.

...and I just tried it, redirected the menu's command line this in one long command

Code: Select all

bash -c "sleep 15 && xfce4-session-logout --logout && systemctl stop getty@tty2"
Not sure the authority on that last part called from the standard user menu? But I flip over in my desktop, and 15 seconds later my screen flips tty's, text scrolling, backdrop, desktop, done, about that fast. And it makes me giggle! WTH So, flip back, ignore...
Oh wait, yes, helpful, it does work and appears graceful if done from my terminal. But no answer yet for 'from that user'

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: Auto login and startx(desktop) without a display manager

#24 Post by Deb-fan »

Just-4-rec: The mighty Linkinator will run just fine on any tty and doesn't require X ... SO THERE !! :D (Edit: CHIT, make that links2 part will the nator would require X :( they are still both awesome and together unstoppable !!! Gawds okay movie time for real.)

Actual reason I'm posting, this stuff had me cycling through tty's for no meaningful reason, while doing so noticed something odd in Firefox, going to just copy/paste from the note I made on it for later dorking.
Funny some weird thing I just found in FF, it's called Caret browsing, you press F7 to turn it off/on and it looks like it's some kind of keyboard mouse, says puts movable cursor in webpgs and allows someone to select text with the keyboard.
LMFrigAO, been using FF since there's been a FF and never heard of this, Caret browsing ? Wth ? :)

PS, definitely wurve Firefox, Debian's the universal OS and FF has got to be the universal web-browser, am sure there are a gazillion things about FF I don't know, gotta wurve a browser that everytime you use the thing you can find something new and interesting. :D @CwF ... again only a thought but switch methods for doing this to what Head_on posted, it's changing two files and a reboot and/or try a display manager too. If you think your issue is related to what's in this tute an obvious 1st step is doing that type of thing. You switch to one of those, same thing happens, nope ... obviously it's something else. In which case you'd have to start a help thread on it, would really need to provide folks MUCH more info in it and honestly wouldn't bother as I'd bet ca$h you aren't going to get any better direction on this in a dedicated thread about it than Head_on already pointed out. Would pursue that and bug him in a PM or summin, if it's really important to you. :)
Most powerful FREE tech-support tool on the planet * HERE. *

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Auto login and startx(desktop) without a display manager

#25 Post by Head_on_a_Stick »

CwF wrote:for 'from that user'
The only way I could think of to do that would be to add the systemctl command to a script then allow the user to run that script (and no other commands) with sudo.
deadbang

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: Auto login and startx(desktop) without a display manager

#26 Post by Deb-fan »

Of course had to dork, so put the override.conf file as it is in the OP and rebooted, nothing unusual, logged my user onto tty4, ran startx to start X, browsed around the web for awhile, killed X with "openbox --exit" took me to the expected command prompt, logged my user out with "exit", switched back to ongoing session on tty1 and back again to check. Am at a loss, everything worked as expected, user was logged out normally. By higher tty's am now assuming you mean higher than the one this logs in on = tty1 and nopers am not seeing the same behavior CwF. Nothing seems amiss and appears to be working normally.

So am left scratching head here and again ... Still thinking it's something to do with how you've set things up ... configuration and have no information about what you've done or how you've set anything up to even speculate about the issue you're having. Still wondering what basis you have to conclude the info in this tute is even involved anyway or a contributing factor ? You're starting X and a web-browser running on tty's 2 and 5 ? Zero idea how you've set any of this up and can't see how that topic or the ongoing issues you're having would be something that belongs in this thread. Ah shrugs, no biggie. :)
Dang it pointless speculation follows anyway. To be honest of course I have no over-riding desire to help a nixer debug some exotic configuration they've hobbled together and that has nothing much to do with autologin/startx with no display manager ...

My understanding gnu/Linux was always intended to be a multi-user/multi-seat operating system. In absence of anything solid to have the slightest idea how you've set things up on the OS CwF, thought is create different users for this, with different uid's/gid's, home directories and all the normal configuration files they would have and use those on these tty's, so that when the user(s) are logged into them(whichever tty's), then X is started automatically and the web-browser you want is too. Then should be no problem to cleanly log them out of any tty's, shouldn't-wouldn't matter how the OS is started with or w/o a display mananger etc etc. Once it's up, none of that should have any effect on the kind of multi-user setup I've outlined above. When the OS is up, it's up. Users can login and out wherever/whenever on the system as expected and it all works predictably.
Most powerful FREE tech-support tool on the planet * HERE. *

CwF
Global Moderator
Global Moderator
Posts: 2636
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 192 times

Re: Auto login and startx(desktop) without a display manager

#27 Post by CwF »

Head_on_a_Stick wrote:with sudo
Ya, there is no sudo.
There is pkexec authority for some, I may have to create something for this. This user has nothing. But I do have a fully funtional root desktop for 'hold my beer' situations, but I don't drink.

Here ya go Deb-fan, it's the condensed version...

Code: Select all

#systemctl edit getty@tty2
------------
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin simpleton --noclear %I $TERM
------------
append /home/simpleton/.profile:
------------
[ "$(tty)" = "/dev/tty2" ] && exec startx
------------
Remember, the system is run normally and boots to tty1. This mod has no bearing until you actually flip over to tty2. tty2 is not logged in until then. That desktop is a stripped xfce. The normal ways to log out work fine, then the autologin simply starts over.

The answer is likely a rule 'to be determined' where i do authority,
that is /etc/polkit-1/localauthority/30-site.d/42-users.pkla
This has mostly eliminated the need for sudo. So as of yet, this bullseye has no sudo. I think preferred, but past systems make heavy use of command enabled sudo in scripts for libvirt and virsh. That has filled out some recently in pkexec, so when I finish up on that, I'll look at this question...

For vm's this works great. Authority is in the rights to start the vm, so....

For now, I'll ignore it.

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: Auto login and startx(desktop) without a display manager

#28 Post by Deb-fan »

At this point can only say good luck, follow your muse and persistence can payoff. :)

Ps, Oops and/or file it away on your 2-dork list, I've got stuff on mine from 1979 just haven't errrr gotten around to yet. :P
Most powerful FREE tech-support tool on the planet * HERE. *

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: Auto login and startx(desktop) without a display manager

#29 Post by Deb-fan »

Dorkish newflash, this just in.

CwF as mentioned what you're trying to do has nothing to do with what's covered in this tute, totally unrelated and different. After much ado about secret browser sessions scattered on tty's, a hold my beer user with super cow powers etc etc. Turns out from the last stuff you posted, you're not even using what's in this thread anyway, what you posted is from the how-to Head_on shared about this topic.

Anyway reason for posting is the answer to the mystery of the immortal and undying X popped into my head. Consists of two things, one ... this type of setup doesn't use a display manager, you go to logout of X, user gets logged right back in and the second part is you've got a line in the users .profile file to autostart x again, which gets sourced over n over, so yeah, doesn't work out really smoothly.

Alrighty that's a wrap ... :)
Most powerful FREE tech-support tool on the planet * HERE. *

Post Reply