You are not logged in.
Hi, i'm trying to configure a machine in this way:
boot -> autologin -> startx for the user -> start a simple windows manager like twm -> start an application that requires a x DISPLAY -> start gunicorn with a web application
in this precise order.
I would like to start the application and gunicorn with systemd, so i guess i have to let systemd start x and twm for the proper user. Any idea how can i do that?
Offline
This won't work in a stable way until system --user is standardized. People worked out a while ago how to do something similar with systemd --user, but if I'm not mistaken, a systemd update broke what they'd done (unsurprising since it was a bit hacky when it was done). If people are still managing to boot to systemd --user, please correct me, I would love to get it setup again. I do know that we still have a wiki page for it.
All the best,
-HG
Offline
At the moment i just created a .service file with
User=theuser
ExecStart=/usr/bin/startx
and it seems to work just file. even if probably is something terribly wrong
Offline
Alternatively, you can run startx from the file .bash_profile / .zprofile like so:
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]] && ! [[ -e /tmp/.X11-unix/X0 ]] && (( EUID )); then
exec startx
fi
Offline