HOWTO: Three ways to use xmltv.sock
#16
rpcameron, thanks for confirming my suspicion. Indeed, my tvheadend service runs as user hts. I had a hunch I may need to run the cron jobs as hts user, yet did not know the proper method to do so.

Thank you kindly for providing the technical insight. Smile
Reply
#17
So, the cronjob for the zap2it epg grabber works, but the cronjob for pushing the data to xmltv.sock using netcat fails silently, no job error/success found when inspecting with mailx ... not sure what the issue is?
Reply
#18
What are you using as your cronjob entry? Are both being run from the same crontab? Does the user running the cronjob that writes to xmltv.sock and the user running TVH both have permissions to xmltv.sock?
Reply
#19
My crontab entry, for user hts, is:

Code:
05 09 * * 0 /home/lance/EPG_zap2xml.sh
10 09 * * 0 /home/lance/tvheadend_xmltv-sock.sh

A file permissions and ownership query reveals that, although I thought I had changed ownership of the scripts, I did not! Sad

Code:
ls -l tvheadend_xmltv-sock.sh EPG_zap2xml.sh
-rwxr-xr-x 1 lance users 129 Jun 16 09:18 EPG_zap2xml.sh
-rwxr-xr-x 1 lance users 163 Jun 26 13:54 tvheadend_xmltv-sock.sh

Code:
ls -l
srwxrwxrwx 1 hts video    0 Jul 11 19:56 xmltv.sock


I think a chown of the scripts to match xmltv.sock will solve the cronjob failure. I will also cp the files into the same directory as xmltv.sock to eliminate any potential conflict there as well.

Thank you for your time!
Reply
#20
If hts is the user running those scripts, why are they in your user directory? For something like that, best practice is to either put them under the home directory of the user running the script (~hts/, in your case), or in /usr/local/bin.
Reply
#21
Yup, planning on moving them over to hts user directory. Why not already there? Lazy Wink
Reply
#22
(2015-01-27, 02:36)dhead Wrote: [...]
3. Use curl, unix socket is relatively new feature of curl v7.40, in OpenELEC this version is only in master branch hopefully in next update it will be available, notice the 5s timeout and the fact I had to supplied some url (doesn't matter which).
Code:
curl -d @xmltv.xml -X POST -m 5 --unix-socket /home/hts/.hts/tvheadend/epggrab/xmltv.sock http://google.com
I use libreelec 8.2.5, I see

wetek:~/.kodi/userdata/addon_data/service.webgrabplus # curl -d @guide.xml -X POST -m 30 --unix-socket /storage/.kodi/userdata/addon_data/service.tvheadend42/epggrab/xmltv.sock  http://google.
com
curl: (28) Operation timed out after 30001 milliseconds with 0 bytes received
wetek:~/.kodi/userdata/addon_data/service.webgrabplus #


Is that expected (it does not matter if I configure 5s or 30s timeout)?

Thanks
Rainer
Reply

Logout Mark Read Team Forum Stats Members Help
HOWTO: Three ways to use xmltv.sock1