You are not logged in.

#1 2013-09-30 03:31:23

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

[SOLVED] optical drive permissions and users on different TTYs

My search-fu is failing me here.

I'm in the process of batch-converting some old CDs to ogg and flac. I am doing this with abcde in an X session (with Openbox). If I switch to another X sessions running on a different console,  abcde fails when trying to read the next track with a permission denied error:

Getting CD track info... cd-discid: /dev/cdrom: open: Permission denied
[ERROR] abcde: CD could not be read. Perhaps there's no CD in the drive?

I have a script set up to keep retrying the command in a loop as long as the abcde control directory exists. When in another X session, the previous error is repeated with each loop. As soon as I switch back to the X session running the script, the loop succeeds and it manages to grab another track. I can immediately switch consoles as soon as it starts grabbing the track and it will continue until it needs to jump to the next one. Disc ejection is also disabled.

It seems that the focused X session takes control of the drive and prevents other sessions from accessing it (which may well be a good security measure). Can someone point me to relevant information and possibly a way to temporarily disable this? It's really annoying having to switch back and forth between consoles just to jump to the next track.

Thanks.

Last edited by Xyne (2013-09-30 22:43:09)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#2 2013-09-30 11:15:01

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,521
Website

Re: [SOLVED] optical drive permissions and users on different TTYs

Are these two xsession using the same user account?  If so, perhaps trying a second user would provide some more diagnostic information.  Just brainstorming, I wonder if logind permissions for a given user are restricted to one tty at a time.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2013-09-30 22:42:42

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: [SOLVED] optical drive permissions and users on different TTYs

The sessions were run by different users. I have just tested it with the same user and there are no permission errors in that case. It is the switch to a different tty that causes this.

When I switch tty, the ACL on the disk device changes (as reported by getfacl). The tty owner is given rw access while all others are denied.

... and *facepalm*

All I needed to do was add the users to the "optical" group. As each user is able to access the drive without this group (and I think the wiki now says the group is unnecessary), I simply hadn't done so. It seems that it's still needed for sharing.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

Board footer

Powered by FluxBB