Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 08-08-2005, 10:03 AM   #1
Registered: Aug 2003
Location: Rochester, MN, U.S.A
Distribution: Gentoo
Posts: 987

Rep: Reputation: 30
set block device 664 always

I wrote a cd ripping script that uses a python module to read the disc id. This id is used for getting song info. The problem is this module fails if run by regular user. I am able to run it as regular user by doing this command]
chmod +r /dev/hdc
it seems to need read access of this block device to run properly. I would like to package this script for other users, but need to know the correct way to allow this module to run as regular user. Is chmod the only way to do this, that is only temporary. After a reboot it needs to be done again.
Old 08-08-2005, 10:18 AM   #2
LQ Guru
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 45
Most of recent distro now use "udev" to manage /dev directory. It's like a "dynamicly generated" /dev folder, just like /proc or /sys.
It's possible to tell udevd to set special permission for certain devices at boot time, look in /etc/udev/rules.d

As example,
KERNEL="hdc",           NAME="%k",GROUP="cdrw" MODE="0664"
will set permission to "664" and the group to "cdrw" for this device.

Note,of course, all this only work if your distribution use udev. Otherwise, you could just add a your chmod line to some bootup script to make sure this is done when you reboot. Or you could give your own script special root priviledge?
Old 08-08-2005, 10:41 AM   #3
Registered: Aug 2003
Location: Rochester, MN, U.S.A
Distribution: Gentoo
Posts: 987

Original Poster
Rep: Reputation: 30
thanks, that seems to be what I need. It may get tricky making this protable to differnt distros. I noticed both my gentoo and ubuntu have a slightly different layout.


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
Block device /dev/sda3 is not a valid root device.. rincewind Linux - Hardware 7 06-09-2006 04:47 AM
What is a New Block Device cthomas Linux - Hardware 9 08-19-2005 11:14 AM
block device name??? franco Debian 2 10-23-2003 05:15 AM
PCMCIA block device frieza Linux - Hardware 4 04-29-2003 06:07 PM
What is a 'block device' rwelch Linux - General 1 03-10-2003 12:05 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:13 PM.

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