FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 09-30-2008, 03:08 PM
Hans Ekbrand
 
Default automounting removable drives on multi-user systems

Hi fellow debian-user(s)

My problem concerns auto-mounting of removable media on multi-user systems.

What I want is a tool/some scripts that:

Whenever a removable media[1] is inserted the user who is owning the
active display [2], should automatically get the device mounted and a
filebrowser should be launched on the mountpoint. (which filebrowser
is up to the user to decide, I prefer mc in terminal, but other users
prefer konqueror). When the user closes the filebrowser, the device
should be automatically unmounted, so a little script will be needed
here.


I know of and use, ivman, which seems be the right tool for this,
since it runs system-wide and once per user.[3] The other users on
this system use KDE, and I don't know:

- if KDE uses ivman or has its own builtin code for handling removable
media.

- if KDE has its own method for this, can that code be deactivated?
Should it be deactivated, or is smart enough to not try mount device
when it runs under an inactive display? (my experience suggests
otherwise)

- Suppose KDE:s mounting can be deactivated, or be configured to use
ivman, so there is only ivman to configure, can ivman be configured
to only mount devices when run by the user who owns the active
display?

If ivman is not up to this, then are there other tools that can do
this? (And do these other tools play well with whatever window-manager
I happen to prefer?)

----------------------------------------------------------------------

[1] For now, I'm just interested in USB-sticks (but auto-playing DVD:s
would be a nice bonus

[2] or current VT, or whatever it is called, but all users are using
their own X-server (e.g. Lisa uses X-server 0 at vt7, Bob, uses
X-server 1 at vt8 and so on).

[3] ivman is started automatically on my system at login-time by
Xsession, as described in the documentation for ivman in Debian).


Kind regards,

--
Note that I use Debian version lenny/sid
Linux samir 2.6.26-1-686 #1 SMP Thu Aug 28 12:00:54 UTC 2008 i686 GNU/Linux
Hans Ekbrand (http://sociologi.cjb.net) <hans@sociologi.cjb.net>
Q. What is that strange attachment in this mail?
A. My digital signature, see www.gnupg.org for info on how you could
use it to ensure that this mail is from me and has not been
altered on the way to you.
 
Old 09-30-2008, 03:37 PM
Ron Johnson
 
Default automounting removable drives on multi-user systems

Spam detection software, running on the system "haggis.homelan", has
identified this incoming email as possible spam. The original message
has been attached to this so you can view it (if it isn't spam) or label
similar future email. If you have any questions, see
the administrator of that system for details.

Content preview: On 09/30/08 10:08, Hans Ekbrand wrote: > Hi fellow debian-user(s)
> > My problem concerns auto-mounting of removable media on multi-user systems.
> > What I want is a tool/some scripts that: > > Whenever a removable media[1]
is inserted the user who is owning the > active display [2], should automatically
get the device mounted and a > filebrowser should be launched on the mountpoint.
(which filebrowser [...]

Content analysis details: (7.7 points, 4.2 required)

pts rule name description
---- ---------------------- --------------------------------------------------
-1.8 ALL_TRUSTED Passed through trusted hosts only via SMTP
-2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1%
[score: 0.0000]
1.1 DNS_FROM_OPENWHOIS RBL: Envelope sender listed in bl.open-whois.org.
11 AWL AWL: From: address is in the auto white-list
 
Old 09-30-2008, 08:50 PM
Hans Ekbrand
 
Default automounting removable drives on multi-user systems

On Tue, Sep 30, 2008 at 10:37:29AM -0500, Ron Johnson wrote:
Content-Description: original message before SpamAssassin
> Date: Tue, 30 Sep 2008 10:37:29 -0500
> From: Ron Johnson <ron.l.johnson@cox.net>
> To: debian-user@lists.debian.org
> Subject: Re: automounting removable drives on multi-user systems
>
> On 09/30/08 10:08, Hans Ekbrand wrote:
> >Hi fellow debian-user(s)
> >
> >My problem concerns auto-mounting of removable media on multi-user systems.
> >
> >What I want is a tool/some scripts that:
> >
> >Whenever a removable media[1] is inserted the user who is owning the
> >active display [2], should automatically get the device mounted and a
> >filebrowser should be launched on the mountpoint. (which filebrowser
>
> GNOME already does this. Konq should be able to be configured to do
> this.

I have used gnome-volume-manager under gnome and it seems to do one
thing right: the user who own's the active display get to mount the
device. However, I haven't tested gnome-volume-manager under KDE+ion3
and I don't know if it is able to give the right user the mount
without the gnome desktop stuff. If gnome-volume-mananger does, than
that might be the tool I want.

> >is up to the user to decide, I prefer mc in terminal, but other users
> >prefer konqueror). When the user closes the filebrowser, the device
> >should be automatically unmounted, so a little script will be needed
> >here.
>
> The problem with this is that the device's buffers need to be
> flushed *before* the device is unplugged.

I see no problem here, umount does not return/finish before the buffers
are synced, and the script will umount and give the user a notice when
the device has been properly umounted.

> That's why devices need to be manually dismounted.

Not with the work-flow I have drafted. When the user is done moving
files, s/he exits the filebrowser, which means that the script
continues, and the next step in the script is umount, and when that is
done, give the user a note (xmessage or whatever). Actually, I already
have such a script working, which when the filebrowser exits asks the
user (using xmessage) if the device should be umounted or not.

Perhaps my usage of removable media is atypical, but I prefer to use
the only when I have to, i.e. when I need to transfer files to
computers where I don't have an account and/or does not have a network
connection.

> I hate to sound like a curmudgeon, but it shouldn't be hard to teach
> users to dismount devices. In GNOME, one of the right-click menu
> choices in a drive's desktop icon is Unmount Volume, and I'm sure
> that KDE does something similar. (Even Windows has the awkward
> Safely Remove Hardware button.)

If the user chooses not let the script umount then, the user will have
to umount manually, as you state, but the default thing to do when I
have tranfered the files, is to umount the device, and I want to be
offered that (and offer that to the other users) with a dialog, don't
you think such an offer is a good idea? Or even, something debian
could offer by default (at least if a automounting daemon like
gnome-volume-manager or ivman is installed on the system)?

> >I know of and use, ivman, which seems be the right tool for this,
> >since it runs system-wide and once per user.[3] The other users on
> >this system use KDE, and I don't know:
> >
> >- if KDE uses ivman or has its own builtin code for handling removable
> > media.
> >
> >- if KDE has its own method for this, can that code be deactivated?
> > Should it be deactivated, or is smart enough to not try mount device
> > when it runs under an inactive display? (my experience suggests
> > otherwise)
>
> KDE has it's own techniques for automounting.

Can they be configured to only be active for the user who owns the
active display?

--
Note that I use Debian version 4.0
Linux amin 2.6.18-4-486 #1 Mon Mar 26 16:39:10 UTC 2007 i586 GNU/Linux
Hans Ekbrand (http://sociologi.cjb.net) <hans@sociologi.cjb.net>
A. Because it breaks the logical sequence of discussion
Q. Why is top posting bad?
 
Old 10-01-2008, 08:13 PM
Florian Kulzer
 
Default automounting removable drives on multi-user systems

On Tue, Sep 30, 2008 at 22:50:33 +0200, Hans Ekbrand wrote:
> On Tue, Sep 30, 2008 at 10:37:29AM -0500, Ron Johnson wrote:
> > On 09/30/08 10:08, Hans Ekbrand wrote:
> > >Hi fellow debian-user(s)
> > >
> > >My problem concerns auto-mounting of removable media on multi-user systems.
> > >
> > >What I want is a tool/some scripts that:
> > >
> > >Whenever a removable media[1] is inserted the user who is owning the
> > >active display [2], should automatically get the device mounted and a
> > >filebrowser should be launched on the mountpoint.

You can configure medium-specific (camera, audio CD, USB stick, etc.)
actions here:

Control Center > Peripherals > Storage Media

This is how KDE behaves by default: All possible actions are presented
as a pop-up menu to the user unless one of them is already configured to
be the "auto action". The pop-up menu has a "do this automatically from
now on" checkbox so that users can set the auto action without having to
mess around in the control center.

The auto action associated with "unmounted <media type>" will be
triggered when a newly-inserted medium of that particular type is
discovered (via hal/dbus). The auto action associated with "mounted
<media type>" will be triggered when the medium is mounted (usually
because the user has clicked the icon that appeared on the desktop when
the medium was inserted).

You can choose pre-defined actions such as "open in file browser" or
"play in media player", or you can add your own action definitions to
run scripts of your choice.

If you want to rely on ivman then you can configure "do nothing" as the
KDE auto action for all relevant media types.

[...]

> > KDE has it's own techniques for automounting.
>
> Can they be configured to only be active for the user who owns the
> active display?

AFAIK, the media-related actions are only active for the user who owns
the currently active KDE session. I never really tested this, though. I
would put a check for this into the mount > open file browser > unmount
script.

--
Regards, | http://users.icfo.es/Florian.Kulzer
Florian |


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




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

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org