[artix-general] Is console autologin possible to start X automatically on Artix?

Fungi4All fungilife at protonmail.com
Mon Jun 3 14:19:14 EEST 2019

On Monday, June 3, 2019 10:14 AM, Stefan Mark via artix-general <artix-general at artixlinux.org> wrote:

> On 29.05.19 09:21, Javier via artix-general wrote:
> On 5/28/19 2:21 PM, Javier via artix-general wrote:
> > Hi,
> > I'm using on Arch console autologin [1] to then auto start X at login [2]. The auto login is mentioned on Arch to be possible due to systemd, however it seems more like a getty + logind artifact. I'm wondering, as elogind is part of Artix, if autologin is also possible on Artix.
> > Not that one can't live without it, just that it's really convenient to me. If you're wondering, I'm always starting with the screen blocked prior to calling the DE/WM on xinitrc...
> Using openrc its simple (should be similar for runit). Each virtual
> console has its own config /etc/conf.d/agetty.ttyX, where X is 1 to 5.
> Chose one (or create another one, at least 1-9 should be no problem) and
> add "-a USERNAME" to the config string. This will make agetty to
> autologin USERNAME on virtual console X.
> Now, open ~/.bash_profile and add after the shebang (remember to replace
> X in ttyX):
> if [ "$(tty | sed -e "s:/dev/::")" == "ttyX" ]; then
> exec startx
> fi
> this will start X when logged in on console X.
> This has nothing to do with elogind though, but i hope it helps
> nevertheless.
> Notes:
> Due to the "exec" before "startx" the shell is exited and replaced by
> startx. After X ends the user will log out. And then in again due to the
> "-a" on agetty. If anything goes wrong: Loop time (at least on Gentoo
> the startup scripts from X have their own loop protection). You can
> remove the "exec", then you end up logged in a console after X exited
> (since the console (usually) has no screen lock, this might be a bad
> thing). Choose wisely.
> Obviously, the agetty and the bash_profile part can be used
> independently to either automatically start X on manual login, or
> automatically login without starting X.
> Do i have to mention that automatic login might be a security issue?

I will soon make a test installation to test this, I am not using OpenRC and I use zsh instead of bash.
One issue I am wondering is let's say X due to a recent update fails to start.  You don't realize this while you are in it but next reboot you are caught in the loop, but you explain the rc is preventing the loops.  So, you have to enter as root to fix this or you must have a backup 2nd account without a .*login /autologin etc.  In some setups this may be perceived as a security problem, the ability to login as root from tty.

Is this why you alert of the choices?  In my setup I like to login as user and start x manually.

More information about the artix-general mailing list