[mythtv-users] Device permissions

aaron memoryguy at gmail.com
Fri Nov 20 19:56:22 UTC 2009

Hi all,

I know this isn't directly MythTV-related, but it's for my mythbox, so... ;)

I'm in the process of rebuilding my system on Slackware 13. I have
been on Slackware 9 for 5+ years (and even before that, way to back to
Myth 0.06 in 2002).

I'm only just now moving to the wonderful world of the 2.6 kernel. At
least, on a box that I actually need/want to tweak. So much has
changed! In particular, udev.

So, the problem is this:
If I start mythbackend from the prompt, everything works perfectly (hooray!)

But when I start mythbackend from daemontools [1], it doesn't have
permission to the /dev/video* nodes (two identical PVR-250s, so video0
and video1)

I'm pretty sure I have an idea where the problem is coming from, I
just don't know how to fix it.

The nodes have permissions:
root at myth:/dev# ls -l video*
crw-rw---- 1 root video 81, 0 2009-11-20 14:21 video0
crw-rw---- 1 root video 81, 4 2009-11-20 14:21 video1
crw-rw---- 1 root video 81, 3 2009-11-20 14:21 video24
crw-rw---- 1 root video 81, 7 2009-11-20 14:21 video25
crw-rw---- 1 root video 81, 1 2009-11-20 14:21 video32
crw-rw---- 1 root video 81, 5 2009-11-20 14:21 video33

Which is fine.... my Myth user is part of the "video" group:
root at myth:/dev# id myth
uid=1000(myth) gid=100(users)

(and again, when I start the backend manually from the prompt
everything is fine)

Daemontools gets started from init, and it runs as root, but I'm using
this command to start the backend:

setuidgid myth /usr/local/bin/mythbackend -l $LOGFILE > /dev/null 2>&1

What that does is run the given command ("mythbackend") as the
specified user ("myth"). Best as I can tell, mythbackend *is* running
as the correct user:

root at myth:/service/mythbackend# ps -ef | grep mythbackend
root      3387  3376  0 13:47 ?        00:00:00 supervise mythbackend
myth     19421 19410  0 14:12 ?        00:00:03
/usr/local/bin/mythbackend -l /var/log/myth/backend.log

...unless I'm reading that incorrectly, the second line is the
backend, and the owner is "myth", the correct user.

If I go to /dev and "chmod a+rw video*" and then get daemontools to
restart the backend, everything works perfectly, so I am certain it is
a permissions problem. But I don't understand why there is a problem,
since it looks to me like things are configured right.

I figured the easy fix would be to add a udev rule to set the
permissions to 0666:

root at myth:/etc/udev/rules.d# cat 11-ivtv.rules
KERNEL=="video[0-9]+", NAME=="video%n", MODE=="0666"

But this doesn't seem to do anything. Is the above correct? Should it work?

I also recall that I wasn't able to get the LIRC udev rule (from the
LIRC site) to work either... which leads me to wonder if there is more
involved in setting up udev rules than just dropping a file into

Can anyone offer any suggestions? Or is there any additional
information that would be helpful?

Thanks in advance,

[1] http://cr.yp.to/daemontools/install.html , I know there are
probably better ways to do it these days, but this was the suggested
tool back when I was initially building the box.

More information about the mythtv-users mailing list