On Wed, Oct 06, 2021 at 03:56:25PM +0100, Phil Endecott wrote:
> > sed -i -e '/ExecStart/s/agetty/agetty -a root/' \
> >     -e '/ExecStart/s/-p/-p -f/' \
> >     /lib/systemd/system/[email protected]
> 
> So I think that is intended to replace this:
> 
> ExecStart=-/sbin/agetty -o '-p -- \\u' --keep-baud 115200,38400,9600 %I $TERM
> 
> with
> 
> ExecStart=-/sbin/agetty -a root -o '-p -f -- \\u' --keep-baud
> 115200,38400,9600 %I $TERM
> 
> man agetty tells me that -a root means "autologin" and man login tells
> me that -f means "do not perform authentication".
> 
> Is there something I should do to make this apply only to ttyS0?
> (Is that a good idea? Not sure.)
> 
> But do I really want to edit /lib/systemd/system/[email protected] ?
> Is that a "conf-file", or whatever the right terminology is? Isn't there
> a file in /etc or /usr/local that I should edit in preference to this one?

No, you don't need to edit /lib/systemd/system/[email protected].
You should instead create a drop-in config fragment for
[email protected] like the following:

# /etc/systemd/system/[email protected]/autologin.conf
[Service]
ExecStart=
ExecStart=-/sbin/agetty -a root -o '-p -f -- \\u' --keep-baud 115200,38400,9600 
%I $TERM

After that, apply the change on the running system with the following,
run as root:
systemctl daemon-reload
systemctl restart [email protected]

noah

Reply via email to