Project

General

Profile

xmltv.sock doesn't exist

Added by Mytril Goldhand almost 7 years ago

Hello,

i have a little problem with systemd and tvheadend.

I have written a script to write an xmltv file and write it to the xmltv.sock.

This script starts at startup after tvheadend, but the xmltv.sock is not available at this time. But why? And what do i neet to change?

My systemd-unit looks like:

[Unit]
Description=Create EPG and HTTP Stream
Requires=network.target tvheadend.service
After=tvheadend.service

[Service]
Type=simple
Restart=always
RestartSec=5
ExecStart=/bin/bash /home/server/Befehle/TV/createEPGandStrean.sh

[Install]
WantedBy=multi-user.target

And the necessarily part of the script is:
cat "/tmp/epg.xml" | socat - UNIX-CONNECT:/home/hts/.hts/tvheadend/epggrab/xmltv.sock

All other things works, the xml file is there and complete and if i restart the service after startup. All does work fine.
I think i need to change "After" but to what?


Replies (2)

RE: xmltv.sock doesn't exist - Added by Robert Cameron almost 7 years ago

You can add a ConditionPathExists= test to your unit file to check for the existence of the socket. This will probably fail at first run as the socket is quite created yet, but your restart condition should have it restart after 5s which ought to be enough for it to succeed on its restart.

RE: xmltv.sock doesn't exist - Added by Mytril Goldhand almost 7 years ago

Thank you, i will try it

    (1-2/2)