FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 10-24-2008, 01:28 AM
Clint Dilks
 
Default Help with custom udev rule

Hi,

I am trying create a custom udev rule to change the group and
permissions on /dev/net/tun.
Some research indicated that rather than directly editing the rule in
/etc/udev/rules.d/50-udev.rules that I should create my own local rules
file something like 10-local.rules which contains

KERNEL=="tun", NAME="net/%k", OWNER="root", GROUP="vboxusers", MODE="0660"

But unfortunately when I reboot the permissions are still

0 crw------- 1 root root 10, 200 Oct 24 14:09 /dev/net/tun

Can anyone tell me what I'm doing wrong? Or point me to some clear
documentation about creating custom udev rules.


Thanks
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-24-2008, 02:18 AM
"Filipe Brandenburger"
 
Default Help with custom udev rule

Hi,

On Thu, Oct 23, 2008 at 21:28, Clint Dilks <clintd@scms.waikato.ac.nz> wrote:
> something like 10-local.rules which contains
> KERNEL=="tun", NAME="net/%k", OWNER="root", GROUP="vboxusers", MODE="0660"
> But unfortunately when I reboot the permissions are still
> 0 crw------- 1 root root 10, 200 Oct 24 14:09 /dev/net/tun
>
> Can anyone tell me what I'm doing wrong? Or point me to some clear
> documentation about creating custom udev rules.

I'm not 100% sure of why this is happening, but I believe that the
rule to create /dev/net/tun in 50-udev.rules is overriding the one you
created. Did you try to create it as 99-local.rules? What about
creating a device with another name so that they do not conflict?

But in general I agree with you that udev is a little tricky and
documentation could be improved...

HTH,
Filipe
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-24-2008, 03:11 AM
"Filipe Brandenburger"
 
Default Help with custom udev rule

Hi,

A google search led me to:
http://reactivated.net/writing_udev_rules.html

There it states that you generally will want your rules before the
system default rules, but in any case it should apply all the rules,
not only the first match, so putting your rule after the defaults
could have some effect.

Also, it seems that the default permissions should be 0660, but for
some reason /dev/net/tun is created with 0600, even though there is
not setting for that in 50-udev.rules... still don't know why.

One other way that might go around this is to use the "last_rule"
option. Apparently, if you add OPTIONS+="last_rule" to the rule it
won't process the further down rules, so this might be one way to fix
your specific problem.

Another useful information from that webpage is the reference to the
"udevtest" command, that I believe could be used to trace exactly what
is happening on your case.

Anyway, I still haven't tried any of those. If you do and find out
what is happening, please share with us your results!

HTH,
Filipe
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-24-2008, 03:17 AM
"Filipe Brandenburger"
 
Default Help with custom udev rule

Hi,

Found another interesting detail. net/tun is listed in
/etc/udev/makedev.d/50-udev.nodes, which starts with this comment:
# These device have to be created manually

I just didn't find who/what actually creates those, and using which
permissions. Anyway, another clue in your puzzle.

HTH,
Filipe
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-28-2008, 02:54 AM
Clint Dilks
 
Default Help with custom udev rule

Filipe Brandenburger wrote:

Found another interesting detail. net/tun is listed in
/etc/udev/makedev.d/50-udev.nodes, which starts with this comment:
# These device have to be created manually

I just didn't find who/what actually creates those, and using which
permissions. Anyway, another clue in your puzzle.


Hi Filipe,

This was a pointer in the right direction. This device file is actually
created by /sbin/MAKEDEV and the configurations files it uses are found
in /etc/makedev.d/ in particular for the device I am interested in it
was the file 01linux-2.6.x.


I have changed this line
c $ROOT 10 200 1 1 net/tun
to
c 0660 root vboxusers 10 200 1 1 net/tun

I am still confused as to why a udev rules exists for the device when it
doesn't seem to ever be applied.


Thanks for the help, and have a nice day.


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 02:03 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org