You are not logged in.

#1 2014-02-26 16:22:57

riccardocagnasso
Member
Registered: 2012-02-22
Posts: 49

manage a graphical software with systemd

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

#2 2014-02-26 16:28:25

HalosGhost
Forum Moderator
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,095
Website

Re: manage a graphical software with systemd

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

#3 2014-02-26 16:50:38

riccardocagnasso
Member
Registered: 2012-02-22
Posts: 49

Re: manage a graphical software with systemd

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

#4 2014-02-26 17:15:39

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: manage a graphical software with systemd

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

Board footer

Powered by FluxBB