LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 08-08-2005, 11:03 AM   #1
shanenin
Member
 
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]
Code:
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, 11:18 AM   #2
Half_Elf
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,
Code:
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, 11:41 AM   #3
shanenin
Member
 
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.
 
  


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


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

Main Menu
Advertisement
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