Edit /etc/systemd/system/getty@tty1.service.d/override.conf:
Code: Select all
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin root --noclear %I $TERM
Code: Select all
systemctl set-default multi-user.target
Code: Select all
if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]]; then
startx
fi
---------------------
As this works for root, I appllied the same approach to user m:
/etc/systemd/system/getty@tty1.service.d/override.conf:
Code: Select all
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin m --noclear %I $TERM
Code: Select all
if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]]; then
startx
fi
error: ...cannot open /dev/tty0, permission denied.
Then I removed the startx part from /home/m/.profile. Rebooted, user m auto logged in. I manually ran "startx", and X started! (The "startx" command was input in tty1, but somehow X started on tty2.)
I googled the "cannot open /dev/tty0..." error and found a lot related topics but none of them was identical to my scenario. It really confuses me why it is fine to manually startx but the .profile script does not work.
Background Info:
version: Debian GNU/Linux 10 (buster) -- minimally installed
Then installed xorg related packages and various video firmware and modules, and awesome wm
No display manager.