1

I'm having difficulties refreshing a screen after kodi-standalone exits. I have a stretch-lite RPI2 installation and starting kodi from command line (with LXDE xserver gui present)

mrkipi@raspberrypi:~ $kodi-standalone

When started from command line like above (and exited from kodi) my display refreshes normally and I can see the screen as before the kodi start.

On the other hand I have prepared a simple service (which would not run on boot) to start the kodi-standalone

[Unit]
Description = Kodi Media Center
After = systemd-user-sessions.service network-online.target sound.target
Wants = systemd-user-sessions.service network-online.target sound.target

[Service]
User = mrkipi
Group = pi
Type = simple
ExecStart = /usr/bin/kodi-standalone
ExecStopPost = /bin/sleep 10
ExecStopPost = /usr/bin/xrefresh
Restart = never

[Install]
WantedBy = multi-user.target

Starting kodi-standalone via this simple service on the other hand does NOT refresh the sceen after kodi exit - but I'd like to do so, therefore I wanted to call

ExecStopPost = /usr/bin/xrefresh

to refresh the lxsession. While this WORKS from the command line

mrkipi@raspberrypi:~ $xrefresh

the service execution gives

kodi.service - Kodi Media Center
   Loaded: loaded (/etc/systemd/system/kodi.service; disabled; vendor preset: en
   Active: failed (Result: exit-code) since Sun 2019-11-17 23:27:40 CET; 31s ago
  Process: 1792 ExecStopPost=/usr/bin/xrefresh (code=exited, status=1/FAILURE)
  Process: 1786 ExecStopPost=/bin/sleep 10 (code=exited, status=0/SUCCESS)
  Process: 1681 ExecStart=/usr/bin/kodi-standalone (code=killed, signal=TERM)
 Main PID: 1681 (code=killed, signal=TERM)

On the other hand ExecStopPost=/bin/sleep 10 works without a problem within the servicestoppost.

How can I refresh the screen within the ExecStopPost OR by executing some other script, which I could also call?

Is this only a problem of TTY not beeing available in the time of ExecStopPost, because the command line xrefresh is working without problems?

Ingo
  • 42,961
  • 20
  • 87
  • 207

1 Answers1

1

The proposed solution from goldilocks (thanks) works like a charm with single xorg instance:

xrefresh -display :0

Looking at it again it is also clear to say which display to refresh.

goldilocks
  • 60,325
  • 17
  • 117
  • 234