This forum has been archived. All content is frozen. Please use KDE Discuss instead.

eject iPod

Tags: None
(comma "," separated)
jaapkroe
Registered Member
Posts
14
Karma
0

eject iPod

Fri Oct 24, 2008 2:59 pm
Can someone help me set up "eject" correctly???

I want amarok to disconnect my iPod in the correct way. So that it doesn't give the message "Connected, Eject before disconnecting" before I unplug it.

For predisconnect I use: mount %d
and for post-disconnect: umount %d

But it want to also do eject, so basically "umount %d && eject %d"
Because when eject my iPod as root "sudo eject /media/ipod", the iPod itself also recognizes that it's safe to disconnect. So this already works(!!), but I don't wanna fire up a terminal everytime I want to unplug my iPod.
Unfortunately I cannot do this as normal user. So I thought I'd edit '/etc/sudoers'. I changed it into this (use visudo to edit!!):

[php]# /etc/sudoers
Defaults env_reset

# Cmnd alias specification
Cmnd_Alias IPOD=/usr/bin/eject

# User privilege specification
root ALL=(ALL) ALL
jaapkroe ALL= NOPASSWD: EJECT
%admin ALL=(ALL) ALL
[/php]

But it doesn't change anything! When I run eject as user, I get:
Code: Select all
$ eject -v /dev/sdc1
eject: device name is `/dev/sdc1'
eject: expanded name is `/dev/sdc1'
eject: `/dev/sdc1' is not mounted
eject: `/dev/sdc1' is not a mount point
eject: `/dev/sdc1' is a multipartition device
eject: unable to open `/dev/sdc1'


And for "eject /media/ipod"

Code: Select all
$eject -v /media/ipod/
eject: device name is `/media/ipod'
eject: expanded name is `/media/ipod'
eject: `/media/ipod' is not mounted
eject: `UUID=1DD6-8990' can be mounted at `/media/ipod'
eject: tried to use `UUID=1DD6-8990' as device name but it is no block device
eject: unable to find or open device for: `/media/ipod'


This UUID relates to my Ipod, because
Code: Select all
$ ls -alF /dev/disk/by-uuid/
[...]
lrwxrwxrwx 1 root root  10 2008-10-24 16:41 1DD6-8990 -> ../../sdc1
[...]


And here's the iPod from my fstab:
Code: Select all
# /etc/fstab: static file system information.
#               
# Ipod
UUID=1DD6-8990 /media/ipod vfat user,noauto,umask=000 0 0


I'm using KDE 4.1.2 and Kernel version 2.6.27-7 on a 64bit Kubuntu install.

Now that I've given you an overkill of information, hopefully someone can help me figure out how to get this working.

It's not an amarok-specific question because it also doesn't work in konsole or whatever terminal.

I think this is a kde-related question, because under Gnome the gnome-eject does work for normal users.


jaapkroe, proud to be a member of KDE forums since 2008-Oct.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

RE: eject iPod

Fri Oct 24, 2008 10:30 pm
Just guessing but doesn't command alias mean that you should be executing sudo ipod /dev/xxx?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
sickrandir
Registered Member
Posts
7
Karma
0

RE: eject iPod

Fri Nov 21, 2008 2:34 pm
kubuntu intrepid 8.10 here.
I had the same problem but I think I found a good solution.
To make the eject command work as a normal user I googled a bit and discovered that adding the user to the "disk" group was enough:
Code: Select all
sudo useradd -G disk myuser


At this point I was able to use it perfectly in amarok with,
Pre-connect command: mount /media/ipod
Post-disconnect command: eject /media/ipod

And now I can mount and eject the ipod perfectly from amarok.
Hope it helps.

Last edited by sickrandir on Fri Nov 21, 2008 2:39 pm, edited 1 time in total.


sickrandir, proud to be a member of KDE forums since 2008-Nov.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]