Difference between revisions of "Troubleshooting:Filesystem Permissions"

From MythTV Official Wiki
Jump to: navigation, search
(Add skeleton and one subtle issue)
 
(Common Issues)
Line 4: Line 4:
  
 
==Common Issues==
 
==Common Issues==
 +
 +
It's quite common thing 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?
 +
<pre>
 +
linux$ ps -fade |grep mythfrontend
 +
</pre>
 +
* What user is the backend running as?
 +
<pre>
 +
linux$ ps -fade |grep mythbackend
 +
</pre>
 +
* If they are different users, are they members of the same user group?
 +
<pre>
 +
linux$ id <mythfrontenduser>  #should return the uid and some gids
 +
linux$ id <mythbackenduser>
 +
</pre>
 +
* Are all the directories mythtv uses owned by those users and are they group-owned by that (shared) group?
 +
<pre>
 +
$ find /var/lib/mythtv -type d ! -user mythtv -exec ls -ld {} \;
 +
$ find /var/lib/mythtv -type d -group mythtv -exec ls -ld {} \;
 +
</pre>
 +
* Do the log files have any clues as to what is going on?
 +
<pre>
 +
$ tail -f /var/log/mythtv/mythbackend.log  #now try doing the thing that is not working
 +
</pre>
 +
* If the filesystems are exported (NFS or CIFS/samba), what are the export permissions?
 +
<pre>
 +
$ less /etc/exports
 +
$ showmount -e
 +
</pre>
 +
* Do the UIDs and GIDs of frontend and backend users match up across your systems?
  
 
==Subtle Issues==
 
==Subtle Issues==

Revision as of 13:04, 2 July 2012

Filesystem Permissions

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

Common Issues

It's quite common thing 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
$ 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 mythtv /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

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

Reference: Thread on mythtv-user titled "Can't watch TV Permission Denied opening recording file despite chmod a+rwx"