Troubleshooting:Filesystem Permissions

From MythTV Official Wiki
Revision as of 14:31, 7 February 2014 by Xojc (talk | contribs) (ACLs on my mount point's parent directory caused quite a permissions headache.)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 /.

Also: some distributions use the path /media as a location for automatically mounting removable storage. So you may do better with a different mountpoint path e.g /data.

Also: be sure to check for Access Control Lists (denoted by a '+' at the end of the permissions on a directory or file displayed with ls -l). You can view the access control list for a directory called '/media/data' with: getfacl /media/data. Adding the 'mythtv' group to the ACL: sudo setfacl -m g:mythtv:rwx /media/data.

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