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 without a display manager - lenny

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: 133 times

Re: auto login and startx without a display manager - lenny

#41 Post by Head_on_a_Stick »

milomak wrote:do i leave the changes i made to inittab?
I'm sorry, I'm not familiar with /etc/inittab or how to use it :?

If you have Kodi autostarting from there, then yes you should probably disable that.
deadbang

milomak
Posts: 2168
Joined: 2009-06-09 22:20
Been thanked: 2 times

Re: auto login and startx without a display manager - lenny

#42 Post by milomak »

thank you good sir. indeed not reverting the innitab changes has kodi loading twice.

you are a scholar and a gentleman.
Desktop: A320M-A PRO MAX, AMD Ryzen 5 3600, GALAX GeForce RTX™ 2060 Super EX (1-Click OC) - Sid, Win10, Arch Linux, Gentoo, Solus
Laptop: hp 250 G8 i3 11th Gen - Sid
Kodi: AMD Athlon 5150 APU w/Radeon HD 8400 - Sid

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

Re: auto login and startx without a display manager - lenny

#43 Post by Head_on_a_Stick »

You're welcome :)

Thread Update for Debian jessie (systemd)

For automatic login, edit the file at /etc/systemd/system/getty.target.wants/getty@tty1.service and change the "ExecStart=" line in the "[Service]" section to this:

Code: Select all

ExecStart=-/sbin/agetty -a <user name> %I $TERM
Replace "<user name>" with your user name.

For automatic `startx` use this snippet in ~/.bash_profile (or ~/.zprofile for zsh users):

Code: Select all

[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx
http://forums.debian.net/viewtopic.php?f=16&t=123694
deadbang

User avatar
Nili
Posts: 441
Joined: 2014-04-30 14:04
Location: $HOME/♫♪
Has thanked: 5 times
Been thanked: 3 times

Re: auto login and startx without a display manager - lenny

#44 Post by Nili »

Head_on_a_Stick wrote:You're welcome :)
Thread Update for Debian jessie (systemd)

For automatic login, edit the file at /etc/systemd/system/getty.target.wants/getty@tty1.service and change the "ExecStart=" line in the "[Service]" section to this:

Code: Select all

ExecStart=-/sbin/agetty -a <user name> %I $TERM
Replace "<user name>" with your user name.
Heya there Head_on_a_Stick,

This part of your code interests me (ofcourse i am using right now)

Code: Select all

ExecStart=-/sbin/agetty -a nili %I $TERM
...but I need a help, since i have actived only two tty "tty1 which startx autostart and tty2 as a backup".

I noticed after startx start on tty1 while on tty2 it is made nili (automatic login). I don't want to stay login all time tty2 (as well couldn't stop with exit because autostart again :)) It must be stopped early on boot.

So, my question: Is there anyway to prevent autologin on tty2?

Many thanks...
Kindly regards

Nili
openSUSE Tumbleweed KDE/Wayland

♫♪ Elisa playing...
Damascus Cocktail ♪ Black Reverie ♪ Dye the sky.

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

Re: auto login and startx without a display manager - lenny

#45 Post by Head_on_a_Stick »

@Nili -- could you post this in my Howto that is specifically for jessie please?
http://forums.debian.net/viewtopic.php?f=16&t=123694

This one is for lenny.

When you post in the other thread, include the output of:

Code: Select all

ls -l /etc/systemd/system/getty.target.wants
deadbang

User avatar
Nili
Posts: 441
Joined: 2014-04-30 14:04
Location: $HOME/♫♪
Has thanked: 5 times
Been thanked: 3 times

Re: auto login and startx without a display manager - lenny

#46 Post by Nili »

I feel so stupid for not reading the topic :| because in addition mixing lenny code for jessie brought me a lot of troubles that i hardly fixed them today with boot resque. I removed all the mistakes made. I am ready to post from start on the appropriate topic.

Sorry for the stupidity, great heat here: sun in head occasionally lol.
openSUSE Tumbleweed KDE/Wayland

♫♪ Elisa playing...
Damascus Cocktail ♪ Black Reverie ♪ Dye the sky.

milomak
Posts: 2168
Joined: 2009-06-09 22:20
Been thanked: 2 times

Re: auto login and startx without a display manager - lenny

#47 Post by milomak »

Head_on_a_Stick wrote:
milomak wrote:i suppose what i wanted to see was how these prepackaged solutions load straight into a kodi without a de loading.
Create a file at ~/.xsession with the following content:

Code: Select all

#!/bin/bash
if [ -z "${DBUS_SESSION_BUS_ADDRESS-}" ] && type dbus-launch >/dev/null; then
  eval $(dbus-launch --sh-syntax --exit-with-session)
fi
source /etc/profile
exec kodi
one thing i noticed is that i am unable to get to a console via alt-Fx. how can i add this?
Desktop: A320M-A PRO MAX, AMD Ryzen 5 3600, GALAX GeForce RTX™ 2060 Super EX (1-Click OC) - Sid, Win10, Arch Linux, Gentoo, Solus
Laptop: hp 250 G8 i3 11th Gen - Sid
Kodi: AMD Athlon 5150 APU w/Radeon HD 8400 - Sid

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

Re: auto login and startx without a display manager - lenny

#48 Post by Head_on_a_Stick »

milomak wrote:i am unable to get to a console via alt-Fx.
Try <Ctrl>+<Alt>+Fx
deadbang

milomak
Posts: 2168
Joined: 2009-06-09 22:20
Been thanked: 2 times

Re: auto login and startx without a display manager - lenny

#49 Post by milomak »

Head_on_a_Stick wrote:
milomak wrote:i am unable to get to a console via alt-Fx.
Try <Ctrl>+<Alt>+Fx
that's what i actually meant :oops:
Desktop: A320M-A PRO MAX, AMD Ryzen 5 3600, GALAX GeForce RTX™ 2060 Super EX (1-Click OC) - Sid, Win10, Arch Linux, Gentoo, Solus
Laptop: hp 250 G8 i3 11th Gen - Sid
Kodi: AMD Athlon 5150 APU w/Radeon HD 8400 - Sid

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

Re: auto login and startx without a display manager - lenny

#50 Post by Head_on_a_Stick »

It could be that Kodi is grabbing the keybind or something.

I'm not sure really.
:?
deadbang

seamusdemora
Posts: 6
Joined: 2024-04-04 01:53
Has thanked: 2 times

Re: auto login and startx without a display manager - lenny

#51 Post by seamusdemora »

So glad to find this thread! I've searched long & hard, but at last I've found the fount of knowledge for autologin. :)
Based on the date of the original post by MeanDean, this topic is 16 years old. Here's to another 16!

Anyway, here's my problem & some specifics that might help:

I am using a Raspberry Pi, and it has the current (bookworm) OS installed - I think they call it "raspbian" (?) - or maybe "Raspberry Pi OS" (?) - but it's based on Debian. I use the "Lite" version of the distro, which means there is no GUI/X/Wayland - all access is via SSH (or serial console).

I've a friend suffering from insomnia, and I'm trying to get the RPi to play a "rain soundtrack" through a Bluetooth speaker. I imagined this would take about 15 minutes, but failed to anticipate that the RPi "Lite" system has no real functional support for Bluetooth. Long story made short, I found "success" after installing pipewire. Afterwards, things worked well - at least for a while...

I discovered that pipewire refuses to run once the user (me/pi) logs out, and this of course causes the sound to stop. I'm not experienced with these things, but my thought was to set up an "auto login" - which is how I came to find this thread. My thinking is that, "As long as I'm logged in, pipewire will run". And finally to get to my questions:

1. There is no '/etc/inittab' any longer - so I can't use MeanDean's original approach. Does that mean I am stuck fiddling with systemd? Or is there a simpler approach e.g. perhaps using the serial console?

2. I found Head-on-a-stick's prescription for systemd auto-login here: (viewtopic.php?p=585569#p585569). It's "only" 9 years old - does anyone know if it still works?

3. Finally, any thoughts on whether or not this "auto login" will cure the problem with pipewire?

Many Thanks,
~S

Post Reply