Page 1 of 1

[SOLVED] Auto login to single-user mode

PostPosted: Dec 1st, '13, 03:18
by paultgg
Hi, I want my computer to automatically login to a particular user, but not to load the desktop (to stay in single-user mode - init 3). What's the best way to do this? (Can't do it from drakconf, since it only gives you the option to load the desktop if you choose to auto-login.)

Re: Auto login to single-user mode

PostPosted: Dec 1st, '13, 08:45
by doktor5000
FWIW, init 3 is not single-user mode, it's multi-user with network support.
You could try something like this (with your user name instead of root) http://superuser.com/a/193189

To change default target with systemd to runlevel 3, you want to set default.target to multi-user.target rather than graphical.target to prevent starting X server.
Could be done e.g. by

Code: Select all
ln -sf /usr/lib/systemd/system/multi-user.target /etc/systemd/system/default.target


The question is more, what do you want to achieve with this?

Re: Auto login to single-user mode

PostPosted: Dec 1st, '13, 19:44
by paultgg
You're right - I meant init 3, NOT single-user mode. And I'm looking to achieve just that: have the computer auto-login with a non-root account, but not start X. In drakconf, you can auto-login and load X. Where are those settings stored, and could they be tweaked to solve the problem?

As for your suggestion, I haven't played much with this stuff since the switch to systemd from init. /etc/init doesn't exist, and there's no tty.conf in /etc/init.d. Could you be more specific?

Re: Auto login to single-user mode

PostPosted: Dec 1st, '13, 21:17
by jiml8
I guess I'm also interested in whether this could be done. Offhand, I don't know how to do it.

That said, I do not recall ever seeing a file named tty.conf, and after reading your post I rooted around in my old Mandriva 2010 (32 bit) installation as well as in a couple of different OpenSUSE installations that predate systemd. Also, such a file, if it existed, would not be found in /etc/init, /etc/init.d/ or /etc/rc.d/init.d - that would be the wrong place for a .conf file.

I think this will help you: https://fedoraproject.org/wiki/Systemd# ... erminal.3F

Re: Auto login to single-user mode

PostPosted: Dec 1st, '13, 21:56
by doktor5000
You probably want to edit /etc/systemd/system/getty.target.wants/ ... ty1.service or /usr/lib/systemd/system/console-getty.service or create a new getty for this purpose.

Or just google around a bit:
https://bbs.archlinux.org/viewtopic.php?id=169483
https://wiki.archlinux.org/index.php/au ... al_console
http://wiki.manjaro.org/index.php?title ... _autologin

Re: [SOLVED] Auto login to single-user mode

PostPosted: Dec 2nd, '13, 02:08
by paultgg
Thanks, that helped.

The solution is to add "--autologin [username]" to the ExecStart line of /usr/lib/systemd/system/getty@.service

e.g.
Code: Select all
ExecStart=-/sbin/agetty --autologin user --noclear %I 38400 linux