TVheadend runs as its own user, tvheadend. And while ps u even shows it running (on my system via its UID instead of the actual username, only this processes has this) xmltv is being kicked off as root. (put an echo `pwd` > /tmp/test; echo $USER >> /tmp/test) into an xml grabber to find this. xmltv grabbers require a config file and some spot to leave information. Now this last bit is probably sorted within tvheadend, it probably reads it into stdout and processes it into its own epg database. So the question then, where would tvheadend tell xmltv grabbers to find their config file? It runs as root (why?!) and it's homedir is /. So /assuming /etc/tvheadend won't work. /etc/password also lists /dev/null as ~ so that can't be relied on either? Using the socket option works of course (probably), but if running as user forces running the xml grabbers as root, then that is really not an option. Reproducible: Always
I'm going to close this as FIXED now that I've changed tvheadend's HOME directory to /etc/tvheadend. XMLTV files should be placed under /etc/tvheadend/.xmltv. Having tried it myself, XMLTV is no longer running as root. I know that tvheadend's XMLTV support has been completely reworked since this was reported.