Skip to main content
Topic: agetty autologin with Xfce and OpenRC (Read 1884 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

agetty autologin with Xfce and OpenRC

Details of creating a tty service were from agetty-guide.md in the OpenRC source package.
# cd /etc/init.d
# ln -s agetty agetty.tty7
# cd /etc/conf.d
# cp agetty agetty.tty7

Edit agetty_options in /etc/conf.d/agetty.tty7
agetty_options="-a <your_user_name>"

(Replace <your_user_name> above along with the angle brackets)
(Optionally add "--noclear" option in agetty.tty1 as well for a nicer display)

Add this to ~/.bashrc
# start x on login
if (( [[ -z $DISPLAY && ! -e /tmp/.X11-unix/X0 ]] ) && (rc-status -r | grep -q 'default')); then
        exec xinit -- /usr/bin/X -nolisten tcp vt7
fi

Contents of ~/.xinitrc
This should be executable, make it executable with $ chmod a+x .xinitrc if needed.
#!/bin/sh
# ~/.xinitrc  Executed by startx
exec startxfce4

Run these commands in a terminal:
#rc-update delete xdm
#rc-update add agetty.tty7 default

Wish for luck and reboot!
It works for my Manjaro OpenRC conversion.

Re: agetty autologin with Xfce and OpenRC

Reply #1
/etc/conf.d/agetty.tty1 was overwritten on an update. I had somehow expected it to be treated as a conf file, given it's location.
/etc/conf.d/agetty.tty7 which had been created was not.
Adding this to /etc/pacman.conf fixes this if agetty.tty1 was modified:
NoUpgrade   = /etc/conf.d/agetty.tty1
Otherwise this autologin setup has continued to work without problems.

Re: agetty autologin with Xfce and OpenRC

Reply #2
NoUpgrade  = /etc/conf.d/agetty.tty1
Please use absolute path for NoUpgrade, they don't work with path that starts with a slash

Code: [Select]
NoUpgrade = etc/conf.d/agetty.tty1

https://wiki.archlinux.org/index.php/Pacman/Pacnew_and_Pacsave#Systemwide_backup_files
If I can hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate!

Re: agetty autologin with Xfce and OpenRC

Reply #3
Thanks for pointing out that, or the next upgrade would have seen the same problem again!  ;D