Troubleshooting:Filesystem Permissions

From MythTV Official Wiki
Revision as of 15:03, 2 July 2012 by Wagnerrp (Talk | contribs)

Jump to: navigation, search

Filesystem Permissions

A lot of problems people have with mythtv can be traced back to filesystem permission issues.

Common Issues

It's quite common for the mythtv backend or frontend programs to not have sufficient permissions to read or write some areas of disk. The details vary by operating system and distributor. The examples given here are for Linux.

Some useful questions to ask when troubleshooting:

  • What user is the frontend running as?
linux$ ps -fade |grep mythfrontend
  • What user is the backend running as?
linux$ ps -fade |grep mythbackend
  • If they are different users, are they members of the same user group?
linux$ id <mythfrontenduser>  #should return the uid and some gids
linux$ id <mythbackenduser>
  • Are all the directories mythtv uses owned by those users and are they group-owned by that (shared) group?
$ find /var/lib/mythtv -type d ! -user mythtv -exec ls -ld {} \;
$ find /var/lib/mythtv -type d -group mythtv -exec ls -ld {} \;
  • Do the log files have any clues as to what is going on?
$ tail -f /var/log/mythtv/mythbackend.log  #now try doing the thing that is not working
  • If the filesystems are exported (NFS or CIFS/samba), what are the export permissions?
$ less /etc/exports
$ sudo showmount -e
* Do the UIDs and GIDs of frontend and backend users match up across your systems?

Subtle Issues

Unable to record, or watch live TV

You have set wide-open permissions but still can't write to a new disk you just installed:

$ ls -l /media/data/mythtv/
drwxrwxrwx 2 mythtv mythtv 4096 Jun 11 12:08 recordings

On Linux, and possibly other UNIXes, check the permissions of the underlying mount point:

$ grep media /etc/fstab
/dev/sdb1 /media/data  ext4 defaults   0  2
$ sudo umount /media/data
$ ls -ld /media/data
drwxr-xr-x 1 root root 4096  Jun 10 11:08 /media/data

The fix is to make the mount point owned by the user that needs to write there.

# chown mythtv:mythtv /media/data
# chmod g+w /media/data
# ls -ld /media/data
drwxrwxr-x 1 myhtv mythtv 4096  Jun 11 13:08 /media/data

Also: check the permissions of each step in the mount path, from /.

Reference: MythTV-Users mailing list "Can't watch TV Permission Denied opening recording file despite chmod a+rwx"