LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 08-05-2008, 06:01 PM   #1
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
Using udev rules to modify floppy permissions


Recently I tried using kfloppy to format a floppy disk. I received a cryptic message, but some quick investigating revealed permissions problems. All of the /dev/fd0* devices are tagged with 640 permissions. Manually modifying those permissions to 660 solved the kfloppy issue.

I can install the same command in my rc.local, but I wondered how to solve the problem with udev. From what I understand, to avoid losing custom rules during any software updating, rather than modify the default set of rules I should create a 99-local.rules file and those rules should override any previous rules created in the default rule set. I created such a file with the following:

KERNEL=="fd[0-9]*", ACTION=="add", RUN+="device_permissions %k* 0660 floppy"

I both restarted the udev service and rebooted but nothing changed. I'm running Slackware 12.1 and KDE 3.5.9.

What is the correct way to change the permissions to 660 through udev?

Thanks.
 
Old 08-06-2008, 11:22 AM   #2
ne pas
Member
 
Registered: Jul 2008
Posts: 55

Rep: Reputation: 23
Try using
Code:
KERNEL="fd[0-9]*", NAME="floppy/%n", SYMLINK="%k", GROUP="floppy", MODE="0660"
 
Old 08-06-2008, 05:35 PM   #3
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
Thanks for responding, but the new rule failed to do what I needed.

After much head scratching, I discovered a few things.

One, the rc.udev script option for restart does not reload the rules before restarting udev. I tested this by copying the cdrom rules from 65-permissions.rules but changing the permissions to 666. Nothing happened when I ran rc.udev restart. Regardless of what I did to my 99-local.rules file, nothing happened.

Second, running rc.udev reload and then rc.udev restart does not reload the rules.

The only method I found successful was to run rc.udev stop and rc.udev start. Therefore I modified the rc.udev restart option to function the same as the start option after killing all udev processes. That worked. My modified script looks like this:

Code:
restart)
killall udevd
sleep 3
udevd --daemon
/sbin/udevtrigger $OPT && /sbin/udevsettle --timeout=120 &
;;
Lastly, I stumbled over a set of 99-local.rules that succeeded. I copied the original default rules but modified the group and permissions.

# change floppy device ownership and permissions
# default permissions are 640, which prevents group users from having write access

# first fix primary devices (/dev/fd0, /dev/fd1, etc.)
# also change group ownership from disk to floppy
KERNEL=="fd[0-9]*", GROUP="floppy", MODE="0660"

# next recreate secondary devices (/dev/fd0u720, /dev/fd0u1440, etc.)
KERNEL=="fd[0-9]*", ACTION=="add", RUN+="create_floppy_devices -c -t $attr{cmos} -m %M -M 0660 -G floppy $root/%k"


I hope this helps somebody.
 
Old 08-22-2008, 03:46 AM   #4
thawn
LQ Newbie
 
Registered: Aug 2008
Posts: 1

Rep: Reputation: 0
Thumbs up Thanks

Yep, helped me. Thanks a lot!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Udev Rules - reg zoobave Linux - Kernel 1 06-20-2007 08:41 AM
udev rules Slackware 11 swampdog2002 Slackware 9 11-17-2006 08:06 PM
slackware-current, udev 0.96, and custom udev rules not working rignes Slackware 6 08-10-2006 04:43 AM
UDEV Rules Location Toods Slackware 1 04-28-2006 03:23 AM
need help fixing my udev rules or ivman rules hedpe Linux - Hardware 2 03-18-2006 11:07 AM


All times are GMT -5. The time now is 01:48 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration