LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 09-22-2017, 08:04 AM   #1
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
Debian Jessie - SystemD - Auto login on tty1 ONLY


Basically what it says, this is for a rpi3 b, but should be systemd generic, I can auto login on all consols but I need to just do an auto login on console 1 ( tty1 ) switching to eg tty2 with ALT F3 should NOT do an auto login but just use the normal console login prompt, I looked at this:
https://blog.sleeplessbeastie.eu/201...t-the-console/

But changing the tty3 to tty1 didn't help as I was still auto logging in at the other consoles.

Plenty of examples of how to turn auto login on/off on google but they all effect all the consoles, I just want console 1 ( tty1 )

Help me Obi Wan!
 
Old 09-22-2017, 04:06 PM   #2
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
The instructions in that link work on my Sid box with one exception: the directory /etc/systemd/system/getty.target.wants can only contain symlinks. So I put the "service" file in the parent directory and linked to it.
Code:
root@debian:/etc/systemd/system# ll getty*
-rw-r--r-- 1 root root 1768 Sep 22 15:50 getty@tty1.service

getty.target.wants:
total 0
lrwxrwxrwx 1 root root 21 Sep 22 15:41 getty@tty1.service -> ../getty@tty1.service

root@debian:/etc/systemd/system# pgrep -a getty
959 /sbin/agetty --noclear tty2 linux
960 /sbin/agetty --noclear tty3 linux
961 /sbin/agetty --noclear tty4 linux
962 /sbin/agetty --noclear tty5 linux
963 /sbin/agetty --noclear tty6 linux
2615 /sbin/agetty --login-pause --autologin root --noclear tty1 linux
 
1 members found this post helpful.
Old 09-22-2017, 04:09 PM   #3
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Maybe this will work?
 
3 members found this post helpful.
Old 09-23-2017, 05:57 AM   #4
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Original Poster
Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
NOT using sid!
NOT using sysv!

Need to login automatically to TTY1 ONLY! NOT ALL TTY's
 
Old 09-23-2017, 07:45 AM   #5
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
The link in Emerson's post describes a systemd method also.

https://wiki.gentoo.org/wiki/Automat...irtual_console

Create a new directory and file:

Code:
mkdir /etc/systemd/system/getty@tty1.service.d
pico /etc/systemd/system/getty@tty1.service.d/override.conf
The contents of the file:
Code:
[Service]
Type=simple
ExecStart=
ExecStart=-/sbin/agetty --autologin username --noclear %I 38400 linux
I have not yet tried this. I do use Debian Stable--mostly the current, Debian 9, but I do have some machines still on Debian 8 Jessie.
 
2 members found this post helpful.
Old 09-23-2017, 06:03 PM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
for me, it is working exactly as you desire with these instructions:
https://wiki.archlinux.org/index.php...irtual_console
 
1 members found this post helpful.
Old 09-24-2017, 07:30 AM   #7
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Original Poster
Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
Thanks ondoho, this is exactly what I wanted, the instructions where a bit confusing as it implies you only have to add the lines shown, this caused a hang on tty1, I had to copy all the contents of the service file and change just those lines in the link, but it now works.

Sorry I snapped a bit in my second post, I had just deleted the partition table from a 2T disk, and then snapped the sd card for my pi! So as you can imagine I was in a bit of a mood, sorry
 
Old 09-24-2017, 11:09 AM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by Keith Hedger View Post
Sorry I snapped a bit in my second post, I had just deleted the partition table from a 2T disk, and then snapped the sd card for my pi! So as you can imagine I was in a bit of a mood, sorry
no offence taken, no worries! ALL CAPS in itself does not irritate me.
 
  


Reply

Tags
auto, debian, login, rpi, systemd



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Devuan 1.0 Officially Released, It's Based on Debian Jessie, but without systemd LXer Syndicated Linux News 0 05-26-2017 06:30 AM
LXer: Devuan 1.0 Jessie beta 2: That’s Debian Jessie minus systemd LXer Syndicated Linux News 0 12-02-2016 02:41 AM
LXer: Debian ships new 'Jessie' release with systemd AND sysvinit LXer Syndicated Linux News 0 04-29-2015 03:20 AM
[SOLVED] Debian Jessie systemd and display manger unmaintanable since ~2014/07/20 jisisv Debian 17 07-28-2014 05:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 08:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration