Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Udev rules on boot?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Matje
l33t
l33t


Joined: 29 Oct 2002
Posts: 619
Location: Hasselt, Belgium

PostPosted: Sun Sep 29, 2013 11:38 am    Post subject: Udev rules on boot? Reply with quote

Hi,

For my KVM machines I have some LVM volumes where the OS is on. To be able to start them as a normal user I wrote a udev file to change the permissions of those volumes so that any user in the KVM group can start those machines, which works.

Code:
ENV{DM_LV_NAME}=="KVM-*", GROUP="kvm", MODE="0660"


This is placed in /etc/udev/rules.d/99-kvm-lvm.rules

When I execute udevadm trigger the permissions are correctly updated on the LVM volumes that have a name starting with KVM-

The problem is when I reboot, the permissions are not there by default, I still have to execute the trigger before they are put correctly. I have temporarily put the trigger in my local start, but that is not a nice solution. What am I missing here? What's the difference between a trigger and normal boot?
_________________
Life is like a box of chocolates... Before you know it, it's empty...
Back to top
View user's profile Send private message
Matje
l33t
l33t


Joined: 29 Oct 2002
Posts: 619
Location: Hasselt, Belgium

PostPosted: Sun Sep 29, 2013 12:16 pm    Post subject: Reply with quote

Well, apparently the trigger alone wasn't enough. While newly created LV's apparently get a symlink from /dev/<VG>/<LV> to the corresponding /dev/dm-* device (which get the correct permissions by the trigger), the ones that already exist at boot are symlinked to /dev/mapper/<VG>-<LV> which are created independent from udev by the initramfs and I can't seem to influence their permissions.

I solved it for now with this local start script but if anyone wants to chime in, feel free :-)

Code:
#!/bin/sh

chown root:kvm /dev/data/KVM-*
chmod 660 /dev/data/KVM-*

_________________
Life is like a box of chocolates... Before you know it, it's empty...
Back to top
View user's profile Send private message
opotonil
l33t
l33t


Joined: 17 Jun 2005
Posts: 801
Location: 127.0.0.1

PostPosted: Fri Oct 11, 2013 12:08 pm    Post subject: Reply with quote

Here is working with (/etc/udev/rules.d/99-custom.rules):
Code:

ENV{DM_NAME}=="vg-name", ACTION=="change", GROUP="kvm"


http://www.localnet.org.es/2013/05/virtualizacion-con-quick-emulator-qemu.html (spanish)
_________________
Localnet
Films Localnet
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum