telarium
Posts: 40
Joined: Mon Jul 02, 2012 9:41 pm

Automatic login no longer working?

Thu May 23, 2013 9:32 pm

I've set up a few Pi's in the past with all of them automatically logging into the default user account on startup. This has been done by following these instructions:

http://elinux.org/RPi_Debian_Auto_Login

However, with my new Raspberry Pi after running apt-get update and apt-get upgrade, this doesn't seem to work anymore. I added this line to the bottom of initttab:

1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1

Does this no longer work? I noticed 1:2345 seems to be replaced now with T0:23. But if I try this...

T0:23:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1

... it totally destroyed my ability to use my Pi any longer.

telarium
Posts: 40
Joined: Mon Jul 02, 2012 9:41 pm

Re: Automatic login no longer working?

Fri May 24, 2013 12:47 am

By the way, this is what the bottom of my inittab file looks like:

Code: Select all


# /etc/inittab: init(8) configuration.
# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $

# The default runlevel.
id:2:initdefault:

# Boot-time system configuration/initialization script.
# This is run first except when booting in emergency (-b) mode.
si::sysinit:/etc/init.d/rcS

# What to do in single-user mode.
~~:S:wait:/sbin/sulogin

# /etc/init.d executes the S and K scripts upon change
# of runlevel.
#
# Runlevel 0 is halt.
# Runlevel 1 is single-user.
# Runlevels 2-5 are multi-user.
# Runlevel 6 is reboot.

l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
# Normally not reached, but fallthrough in case of emergency.
z6:6:respawn:/sbin/sulogin

# What to do when CTRL-ALT-DEL is pressed.
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

# Action on special keypress (ALT-UpArrow).
#kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this work."

# What to do when the power fails/returns.
pf::powerwait:/etc/init.d/powerfail start
pn::powerfailnow:/etc/init.d/powerfail now
po::powerokwait:/etc/init.d/powerfail stop

# /sbin/getty invocations for the runlevels.
#
# The "id" field MUST be the same as the last
# characters of the device (after "tty").
#
# Format:
#  <id>:<runlevels>:<action>:<process>
#
# Note that on most Debian systems tty7 is used by the X Window System,
# so if you want to add more getty's go ahead but skip tty7 if you run X.
#
1:2345:respawn:/sbin/getty --noclear 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
6:23:respawn:/sbin/getty 38400 tty6

# Example how to put a getty on a serial line (for a terminal)
#
#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100

# Example how to put a getty on a modem line.
#
#T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3


#Spawn a getty on Raspberry Pi serial line
#1:2345:respawn:/sbin/getty 115200 tty1
1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1


Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Automatic login no longer working?

Fri May 24, 2013 1:55 am

Note that that advice (on that page) is pretty much out-of-date and should be ignored.

It's not the best method for doing this.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

telarium
Posts: 40
Joined: Mon Jul 02, 2012 9:41 pm

Re: Automatic login no longer working?

Fri May 24, 2013 2:14 am

What method should be used?

User avatar
rpdom
Posts: 14696
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Automatic login no longer working?

Fri May 24, 2013 5:05 am

It doesn't say to add

Code: Select all

#1:2345:respawn:/sbin/getty 115200 tty1
1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
to the end of the file.

It says to find the existing

Code: Select all

1:2345:respawn:/sbin/getty 115200 tty1
line, put a "#" in front of it and add the new line directly after it.

As you haven't put a # in front of the original line in the file it will still get executed and ask for a login as normal, and your new line will never be used.

telarium
Posts: 40
Joined: Mon Jul 02, 2012 9:41 pm

Re: Automatic login no longer working?

Fri May 24, 2013 5:25 am

If you look at the full code I posted, isn't this the case? I commented out the original line and added the new one.

raspuser
Posts: 17
Joined: Wed May 08, 2013 5:05 am

Re: Automatic login no longer working?

Fri May 24, 2013 5:54 am

Just like rpdom said, you are not supposed to add:

Code: Select all

#1:2345:respawn:/sbin/getty 115200 tty1
1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
... but to comment (#) the existing

Code: Select all

1:2345:respawn:/sbin/getty 115200 tty1
After that, add the following line below the previous one ( i.e the commented one )

Code: Select all

1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
Your file contains twice:

Code: Select all

#1:2345:respawn:/sbin/getty 115200 tty1
1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
Just delete the second

Code: Select all

1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
... which is at the bottom of your file.

telarium
Posts: 40
Joined: Mon Jul 02, 2012 9:41 pm

Re: Automatic login no longer working?

Fri May 24, 2013 4:27 pm

I think there's some confusion here. Again, if you look at the full code I posted, this line appears once and only once. The line that I was supposed to comment out is indeed commented out. There are no extra commands like you're suggesting.

Here's the full code again:

Code: Select all

# /etc/inittab: init(8) configuration.
# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $

# The default runlevel.
id:2:initdefault:

# Boot-time system configuration/initialization script.
# This is run first except when booting in emergency (-b) mode.
si::sysinit:/etc/init.d/rcS

# What to do in single-user mode.
~~:S:wait:/sbin/sulogin

# /etc/init.d executes the S and K scripts upon change
# of runlevel.
#
# Runlevel 0 is halt.
# Runlevel 1 is single-user.
# Runlevels 2-5 are multi-user.
# Runlevel 6 is reboot.

l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
# Normally not reached, but fallthrough in case of emergency.
z6:6:respawn:/sbin/sulogin

# What to do when CTRL-ALT-DEL is pressed.
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

# Action on special keypress (ALT-UpArrow).
#kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this work."

# What to do when the power fails/returns.
pf::powerwait:/etc/init.d/powerfail start
pn::powerfailnow:/etc/init.d/powerfail now
po::powerokwait:/etc/init.d/powerfail stop

# /sbin/getty invocations for the runlevels.
#
# The "id" field MUST be the same as the last
# characters of the device (after "tty").
#
# Format:
#  <id>:<runlevels>:<action>:<process>
#
# Note that on most Debian systems tty7 is used by the X Window System,
# so if you want to add more getty's go ahead but skip tty7 if you run X.
#
1:2345:respawn:/sbin/getty --noclear 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
6:23:respawn:/sbin/getty 38400 tty6

# Example how to put a getty on a serial line (for a terminal)
#
#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100

# Example how to put a getty on a modem line.
#
#T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3


#Spawn a getty on Raspberry Pi serial line
#1:2345:respawn:/sbin/getty 115200 tty1
1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
"1:2345:respawn:/sbin/getty 115200 tty1" appears once and only once, and it is commented out. Yet the Pi still will not automatically log me in.

Apologies if I'm being dense, but I don't see what you are referring to.

telarium
Posts: 40
Joined: Mon Jul 02, 2012 9:41 pm

Re: Automatic login no longer working?

Fri May 24, 2013 5:05 pm

Okay, I see my confusion. The line I needed to comment out was "1:2345:respawn:/sbin/getty --noclear 38400 tty1"

I guess I was following the instructions too literally, where it listed the line as "1:2345:respawn:/sbin/getty 115200 tty1". I'm assuming this must have changed with the more recent Raspi release.

User avatar
rpdom
Posts: 14696
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Automatic login no longer working?

Fri May 24, 2013 5:15 pm

telarium wrote:Okay, I see my confusion. The line I needed to comment out was "1:2345:respawn:/sbin/getty --noclear 38400 tty1"

I guess I was following the instructions too literally, where it listed the line as "1:2345:respawn:/sbin/getty 115200 tty1". I'm assuming this must have changed with the more recent Raspi release.
Sorry, maybe we should have been more clear on that too.

The "1:2345:" identifies the line and when it will be used. The rest of the line is what it should do.

mathewL
Posts: 3
Joined: Tue May 21, 2013 12:03 am
Location: Portland, OR
Contact: Website

Re: Automatic login no longer working?

Fri Aug 23, 2013 1:59 am

The line you tried in fact doesn't work. What you want to use is:

Code: Select all

#1:2345:respawn:/sbin/getty --noclear 38400 ttyl
1:2345:respawn:sbin/getty --autologin {USERNAME} --noclear 38400 tty1
thanks to:
http://raspberrypi.stackexchange.com/qu ... n-raspbian

Return to “Beginners”