0

This is on Xubuntu 18.04.

I'm trying to replace lightdm with my own application running full screen on boot up.

I can run xinit from root shell, and it correctly takes my /root/.xinitrc commands and runs my program full screen.

which xinit  #gives "/usr/bin/xinit"

I tried to make a /lib/systemd/system/fullscreen.service with:

[Unit]
Description=Fullscreen App
#Conflicts=getty@tty7.service plymouth-quit.service
#After=systemd-user-sessions.service getty@tty7.service plymouth-quit.service

[Service]
ExecStart=/usr/bin/xinit

But when I run

systemctl daemon-reload
systemctl start fullscreen

It just loads an xterm terminal logged into root.

any ideas why there is any difference between the two? And how to make it run the same as xinit directly?

0

For processes started as a system-wide service, the $HOME environment variable will be unset unless you specifically set it. And xinit will most likely use that to find $HOME/.xinitrc - i.e. /root/.xinitrc if you run the command from a root shell.

A simple way to add the environment variable would be to add this line:

Environment="HOME=/root"

to the [Service] section of your service file.

4
  • That makes sense! I see a lot a mixed data on the way to set ENV variables in service units... any idea on the best way? – MicDunDee Feb 15 '20 at 11:13
  • Please see my edit. – telcoM Feb 15 '20 at 18:32
  • Perfect! Thank you. I’ll test on next work day and then mark as accepted answer if all is well 👍🏻 – MicDunDee Feb 15 '20 at 19:40
  • Worked perfectly! Thank you. – MicDunDee Feb 18 '20 at 22:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.