You are not logged in.

#1 2020-04-16 12:07:01

POGMAN
Member
Registered: 2019-08-01
Posts: 3

How to run multiple "standalone" application

Hi,
I am trying to run both Kodi and Retroarch in "standalone" mode using systemd services.

I used kodi-standalone-service (AUR) as base for both services.
Here are said services files:

kodi.service

[Unit]
Description=Kodi standalone (X11)
After=remote-fs.target systemd-user-sessions.service network-online.target nss-lookup.target sound.target bluetooth.target polkit.service upower.service mysqld.service
Wants=network-online.target polkit.service upower.service
Conflicts=getty@tty1.service

[Service]
User=kodi
Group=kodi
PAMName=login
TTYPath=/dev/tty1
Environment=WINDOWING=x11
ExecStart=/usr/bin/xinit /usr/bin/kodi-standalone -- :0 -nolisten tcp vt1
Restart=on-abort
StandardInput=tty
StandardOutput=journal

[Install]
WantedBy=graphical.target

retroarch.service

[Unit]
Description=Systemd service and user to run Retroarch in stand-alone mode
After=remote-fs.target systemd-user-sessions.service network-online.target nss-lookup.target sound.target bluetooth.target polkit.service upower.service mysqld.service
Wants=network-online.target polkit.service upower.service
Conflicts=getty@tty2.service

[Service]
User=brix
Group=users
PAMName=login
TTYPath=/dev/tty2
Environment=WINDOWING=x11
ExecStart=/usr/bin/xinit /usr/bin/retroarch -- :0 -nolisten tcp vt2
Restart=always
Restart=on-abort
StandardInput=tty
StandardOutput=journal

[Install] 
WantedBy=graphical.target

Basically I changed tty1/vt1 to tty2/vt2 so retroarch would run on tty2 and I would be able toggle from one to another with Ctrl+Alt+F1/F2

But it doesn't work...
Kodi starts just fine but when I try to start retroarch I end up with an error "Server is already active for display 0"

So i suspect I don't have the right approach here, does anyone have any idea how to achieve this or what's is wrong with my services files?

Thanks!

PS: I also tried retroarch-standalone-service (AUR) with the same result.

Offline

#2 2020-04-16 12:16:16

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,860

Re: How to run multiple "standalone" application

ExecStart=/usr/bin/xinit /usr/bin/kodi-standalone -- :0 -nolisten tcp vt1
ExecStart=/usr/bin/xinit /usr/bin/retroarch -- :0 -nolisten tcp vt2

:0 is the X11 display…

Offline

#3 2020-04-16 12:18:57

progandy
Member
Registered: 2012-05-17
Posts: 5,321

Re: How to run multiple "standalone" application

The error tells you that an xorg server is already running for the display called "0", If you want to run a second x server, you'll have to choose a different display.

Last edited by progandy (2020-04-16 12:19:18)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#4 2020-04-16 13:24:46

POGMAN
Member
Registered: 2019-08-01
Posts: 3

Re: How to run multiple "standalone" application

seth wrote:
ExecStart=/usr/bin/xinit /usr/bin/kodi-standalone -- :0 -nolisten tcp vt1
ExecStart=/usr/bin/xinit /usr/bin/retroarch -- :0 -nolisten tcp vt2

:0 is the X11 display…

So if I replace :0 by :1 in one of the unit would do the trick?

Offline

#5 2020-04-16 13:51:40

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,860

Re: How to run multiple "standalone" application

Feel encouraged to try.

Offline

#6 2020-04-16 14:34:56

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,520
Website

Re: How to run multiple "standalone" application

Or replace one of them by :3 or :7, it really doesn't matter as long as they are different.  I've always found it frustrating that vt numbers start from 1 yet most people number Xorg displays starting from 0.  Just because xorg allows :0 as a display number doesn't mean you have to use it.

My system is set up to make the display and vt number the same: :1 on vt1, :2 on vt2, etc.  If I ever need an xorg display not running on a local tty, I'd just use a display number larger than the number of ttys (or maybe I could use :0 for that).


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB