Unix Technical Forum

eject doesn't like user

This is a discussion on eject doesn't like user within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> I'm using slack-9.0. eject will eject my /dev/cdrom as root, but won't as user. I get the error message ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-18-2008, 09:46 AM
gh
 
Posts: n/a
Default eject doesn't like user

I'm using slack-9.0. eject will eject my /dev/cdrom as root, but won't as
user. I get the error message eject: unable to open `/dev/cdrom'. My
/etc/fstab is:

/dev/cdrom /mnt/cdrom iso9660 noauto,users,ro 0 0 .... and ...

root :~# ls -l /dev/cd*
lrwxrwxrwx 1 root root 8 Jun 17 15:09 /dev/cdrom ->
/dev/hdc
root :~# ls -l /dev/hdc
brw-rw---- 1 root disk 22, 0 Jun 9 2002 /dev/hdc

Any tips on how to get this working under user?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-18-2008, 09:46 AM
Rene Herman
 
Posts: n/a
Default Re: eject doesn't like user

gh wrote:

> root :~# ls -l /dev/hdc
> brw-rw---- 1 root disk 22, 0 Jun 9 2002 /dev/hdc
>
> Any tips on how to get this working under user?


Add the user to the "disk" group. That is, open up /etc/group in an
editor, add the username to the end of list for the disk group, save it
and log the user out and in again.

Rene.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-18-2008, 09:46 AM
Jason Dumler
 
Posts: n/a
Default Re: eject doesn't like user

gh wrote:
> I'm using slack-9.0. eject will eject my /dev/cdrom as root, but won't as
> user. I get the error message eject: unable to open `/dev/cdrom'. My
> /etc/fstab is:
>
> /dev/cdrom /mnt/cdrom iso9660 noauto,users,ro 0 0 .... and ...
>


I don't know if this is the actual solution, but it works for me.
Change the 'users' in your fstab file to 'user' instead.

man mount gives you the information about the 'user' option in fstab.

Jason

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-18-2008, 09:46 AM
gh
 
Posts: n/a
Default Re: eject doesn't like user

Jason Dumler wrote:

> gh wrote:
>> I'm using slack-9.0. eject will eject my /dev/cdrom as root, but won't
>> as
>> user. I get the error message eject: unable to open `/dev/cdrom'. My
>> /etc/fstab is:
>>
>> /dev/cdrom /mnt/cdrom iso9660 noauto,users,ro 0 0 .... and ...
>>

>
> I don't know if this is the actual solution, but it works for me.
> Change the 'users' in your fstab file to 'user' instead.
>
> man mount gives you the information about the 'user' option in fstab.
>
> Jason


No, this doesn't work in this case. hmmmm.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-18-2008, 09:46 AM
Jim Bianchi
 
Posts: n/a
Default Re: eject doesn't like user

On Thu, 03 Jul 2003 20:15:19 GMT, gh <ghwbush@earthlink.net> wrote:
>Jason Dumler wrote:
>
>> gh wrote:
>>> I'm using slack-9.0. eject will eject my /dev/cdrom as root, but won't
>>> as user. I get the error message eject: unable to open `/dev/cdrom'. My
>>> /etc/fstab is:
>>>
>>> /dev/cdrom /mnt/cdrom iso9660 noauto,users,ro 0 0 .... and ...
>>>

>> I don't know if this is the actual solution, but it works for me.
>> Change the 'users' in your fstab file to 'user' instead.
>>
>> man mount gives you the information about the 'user' option in fstab.
>>
>> Jason

>
>No, this doesn't work in this case. hmmmm.


This one still bites me. No one should be 'in' /mnt/cdrom (even if
they're not doing anything there) in order to unmount it. The eject script
first unmounts the CD then ejects the tray. Ensure you've cd'd to some other
dir before invoking eject.

--
jimbo@sonic.net
Eclectic Garbanzo BBS, (707) 539-1279

"My parents just came back from a planet where the dominant lifeform
had no bilateral symmetry, and all I got was this stupid F-Shirt."
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-18-2008, 09:46 AM
Martigan
 
Posts: n/a
Default Re: eject doesn't like user

On Thu, 03 Jul 2003 00:01:50 +0000, gh wrote:

> I'm using slack-9.0. eject will eject my /dev/cdrom as root, but won't as
> user. I get the error message eject: unable to open `/dev/cdrom'. My
> /etc/fstab is:
>
> /dev/cdrom /mnt/cdrom iso9660 noauto,users,ro 0 0 .... and ...
>
> root :~# ls -l /dev/cd*
> lrwxrwxrwx 1 root root 8 Jun 17 15:09 /dev/cdrom ->
> /dev/hdc
> root :~# ls -l /dev/hdc
> brw-rw---- 1 root disk 22, 0 Jun 9 2002 /dev/hdc
>
> Any tips on how to get this working under user?



Thanx for asking this question, I totaly didn't rember to change the owner
to user!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-18-2008, 09:46 AM
gh
 
Posts: n/a
Default Re: eject doesn't like user

Jim Bianchi wrote:

> This one still bites me. No one should be 'in' /mnt/cdrom (even if
> they're not doing anything there) in order to unmount it. The eject
> script first unmounts the CD then ejects the tray. Ensure you've cd'd to
> some other dir before invoking eject.


No, that's not the problem. When I am still in the directory, the error
message is that it won't umount. I'm able to exit the directory and
umount as user, but eject still gives the error message.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-18-2008, 09:47 AM
Jim Bianchi
 
Posts: n/a
Default Re: eject doesn't like user

On Fri, 04 Jul 2003 02:57:12 GMT, gh <ghwbush@earthlink.net> wrote:
>Jim Bianchi wrote:
>> This one still bites me. No one should be 'in' /mnt/cdrom (even if
>> they're not doing anything there) in order to unmount it. The eject
>> script first unmounts the CD then ejects the tray. Ensure you've cd'd to
>> some other dir before invoking eject.

>
>No, that's not the problem. When I am still in the directory, the error
>message is that it won't umount. I'm able to exit the directory and
>umount as user, but eject still gives the error message.


Hmmm, bummer. At this point, I'd recommend you have a look at the
permissions for both /dev/cdrom and /dev/hdc <or whatever the mount point
is>. /dev/cdrom is prob a symbolic link to /dev/hdc or whatever. They both
want to have the same permissions. Just because the first has them won't get
you much if the other doesn't. If you're root, of course, you can eject the
CD tray. Oops, if the perms are wrong, you shouldn't be able to umount the
device (I *think*). So maybe I'm all wet, it bears looking into anyway.

There is likely a better way to do this, such as editing a file
somewhere to add your username to some group that has eject perms, but I
don't know it, sorry. Whoops, I just found out that eject isn't a script,
it's a binary file. Here's the output:

[garbanzo:/home/jimbo]$ /usr/bin/eject -h
Eject version 2.0.2 by Jeff Tranter (tranter@pobox.com)
Usage:
eject -h -- display command usage and exit
eject [-vnrsfq] [<name>] -- eject device
eject [-vn] -d -- display default device
eject [-vn] -a on|off|1|0 [<name>] -- turn auto-eject feature on or off
eject [-vn] -c <slot> [<name>] -- switch discs on a CD-ROM changer
eject [-vn] -t [<name>] -- close tray
Options:
-v -- enable verbose output
-n -- don't eject, just show device
found
-r -- eject CD-ROM
-s -- eject SCSI device
-f -- eject floppy
-q -- eject tape
Long options:
-h --help -v --verbose -d --default
-a --auto -c --changerslot -t --trayclose
-r --cdrom -s --scsi -f --floppy
-q --tape -n --noop
Parameter <name> can be a device file or a mount point.
If omitted, name defaults to drom'.
By default tries -r, -s, -f, and -q in order until success.

I hope this is helpful.

--
jimbo@sonic.net
Eclectic Garbanzo BBS, (707) 539-1279

"My parents just came back from a planet where the dominant lifeform
had no bilateral symmetry, and all I got was this stupid F-Shirt."
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-18-2008, 09:47 AM
Mark Hill
 
Posts: n/a
Default Re: eject doesn't like user

On 2003-07-04,
Jim Bianchi <jimbo@sonic.net> wrote:
>
> At this point, I'd recommend you have a look at the
> permissions for both /dev/cdrom and /dev/hdc <or whatever the mount point
> is>. /dev/cdrom is prob a symbolic link to /dev/hdc or whatever. They both
> want to have the same permissions.


That's not possible when symbolic links have permissions like this.

lrwxrwxrwx 1 root root 8 Aug 13 2002 /dev/cdrom -> /dev/hdc
^^^^^^^^^^
> There is likely a better way to do this, such as editing a file
> somewhere to add your username to some group that has eject perms, but I
> don't know it, sorry.


Yes, you can add your name to the disk group in /etc/group (as was
mentioned elsewhere in this thread). You can see that this is the group
to be added to by doing a 'ls -l' on the device the /dev/cdrom link is
pointing to.

mark ~$ ls -l /dev/hdc
brw-rw-rw- 1 root disk 22, 0 Jun 9 2002 /dev/hdc
^^^^
In 8.1, the permissions mean you don't have to be in the disk group, but
as I understand it, the default permissions in 9.0 are brw-rw---- .

> Whoops, I just found out that eject isn't a script,
> it's a binary file. Here's the output:


FWIW, I like to create an alias called 'insert', as typing that is a bit
more intuitive that 'eject -t'

alias insert='/usr/bin/eject -t'

--
Mark Hill <mark_usenet@yahoo.co.uk>
Not to worry, you're running Linux.
-- Glenn Stone, Linux Journal
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-18-2008, 09:47 AM
Two Ravens
 
Posts: n/a
Default Re: eject doesn't like user

Mark Hill wrote:


> Yes, you can add your name to the disk group in /etc/group (as was
> mentioned elsewhere in this thread).


If you just want to eject the disk as a user this works, it also has the
advantage that root can add specified users to the disk group, as
opposed to 'users'.

--
Two Ravens
"...hit the squirrel..."
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:59 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com