You are not logged in.

#1 2021-12-20 11:25:03

spikeyamk
Member
Registered: 2021-06-17
Posts: 3

Adding another GRUB boot menuentry that disables getty autologin

I use this getty systemd service to autologin into an account

[root@xxxx xxxxx]# cd /etc/systemd/system/getty@tty1.service.d/
[root@xxxx getty@tty1.service.d]# ls override.conf
[root@xxxx getty@tty1.service.d]# cat override.conf
[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --autologin xxxxx --noclear %I $TERM

 

How to create another GRUB boot entry that would disable this autologin? Maybe run a simple script that would comment out these lines or something. But I have no idea how to do that. I tried installing openrc into Arch Linux but that seemed like too big of a hassle. I tried init=/bin/bash, but that didn't work, it didn't even initialize my keyboard, so I couldn't type... What's the best way to achieve this?

Last edited by spikeyamk (2021-12-20 11:25:30)

Offline

#2 2021-12-20 12:01:08

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Adding another GRUB boot menuentry that disables getty autologin

You can mask a unit file from the kernel command line:

systemd.mask=getyy@tty1.service

But that would stop TTY1 from ever starting and so leave you at a blank screen after booting. The other (a)gettys would still work as normal though.


Jin, Jîyan, Azadî

Offline

#3 2021-12-20 12:10:49

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,169

Re: Adding another GRUB boot menuentry that disables getty autologin

https://www.freedesktop.org/software/sy … mmandLine=
And pass eg. "autologin" or "noautologin" and test the condition accordingly?

Edit: and have a complementary service in getty.target.wants, name one getty_auto@tty1.service or so

Last edited by seth (2021-12-20 12:18:40)

Online

Board footer

Powered by FluxBB