[SOLVED] Auto login to single-user mode

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

[SOLVED] Auto login to single-user mode

Postby paultgg » Dec 1st, '13, 03:18

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.)
Last edited by paultgg on Dec 2nd, '13, 02:04, edited 1 time in total.
paultgg
 
Posts: 45
Joined: Sep 1st, '11, 19:30

Re: Auto login to single-user mode

Postby doktor5000 » Dec 1st, '13, 08:45

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?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18071
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Auto login to single-user mode

Postby paultgg » Dec 1st, '13, 19:44

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?
paultgg
 
Posts: 45
Joined: Sep 1st, '11, 19:30

Re: Auto login to single-user mode

Postby jiml8 » Dec 1st, '13, 21:17

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
jiml8
 
Posts: 1254
Joined: Jul 7th, '13, 18:09

Re: Auto login to single-user mode

Postby doktor5000 » Dec 1st, '13, 21:56

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
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18071
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

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

Postby paultgg » Dec 2nd, '13, 02:08

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
Last edited by doktor5000 on Dec 2nd, '13, 20:34, edited 1 time in total.
Reason: added code tags, to improve on clarity
paultgg
 
Posts: 45
Joined: Sep 1st, '11, 19:30


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest