mythtv-status should be run as the same user as mythtv

Bug #237564 reported by Björn Torkelsson on 2008-06-05
Affects Status Importance Assigned to Milestone
mythtv-status (Ubuntu)

Bug Description

Binary package hint: mythtv-status

/etc/init.d/mythtv-status should run mythtv-status as the same user as the backend (or maybe it is enough as the same user as the frontend in case the are different) is running as root most likely does not have a valid .mythtv/config.xml

Andrew Ruthven (andrew-etc) wrote :

But what happens if you don't have a frontend on the box? What happens if the .mythtv/config.xml still doesn't exist?

My preference is use a modified which doesn't require accessing the database. I've made the modification, I just need to submit the patch to the MythTV trac instance.

The second option is to have all the UPnP modules installed so that UPnP can be used. Of course, then still needs to be modified to not tell the user that it has used UPnP. (More patches I have sitting here waiting to be submitted.)

Mario Limonciello (superm1) wrote :

I think the actual solution should be running as the mythtv daemon user. This user is available on all systems w/ some variety of MythTV installed (packaged of course). So make mythtv-status depend on mythtv-common, and make it's cron job launch as 'mythtv'.

Björn Torkelsson (torkel) wrote :

That won't work if you want to update /etc/motd with the mythtv-status output and as all the cron job does is calling /etc/init.d/mythtv-status you probably have to just call mythtv-status as 'mythtv' and let the rest be run as root. On the other hand I think the init.d script is a bit strange. Why doi you need an init.d script when you usually are calling it from cron?

Andrew Ruthven (andrew-etc) wrote :

mythtv-status could run as the mythtv daemon user, but does the mythtv daemon user have the config.xml file? (I'm not running 0.21 yet, so can't check).

As Björn points out you can't just have the cron job run the init script as the mythtv user due to needing to write to /etc/motd, but the init script could run mythtv-status as the mythtv user.

Why have the init.d script? So that on system bootup the motd is set correctly rather than having to wait for the cronjob to run.

I'd still prefer to see fixed. This would solve this and some other problems. Given the way that I'm using, it has no need what so ever to contact the database, so config.xml is not actually required for the current user case. I can tell where the host is (because mythtv-status knows), but this patch is unlikely to hit the 0.21-fixes branch.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers