All of lore.kernel.org
 help / color / mirror / Atom feed
* Looking for a per user submount...
@ 2008-01-28 10:11 Francesco P. Lovergine
  2008-01-29  1:42 ` Ian Kent
  0 siblings, 1 reply; 7+ messages in thread
From: Francesco P. Lovergine @ 2008-01-28 10:11 UTC (permalink / raw)
  To: autofs

I was looking for some sort of automounting for per-user subtrees.
Essentially I need to bind-mount on demand some per user (users are sql-based)
subdir like /path/<user>/mount_point, where /path/<user> is a true dir. 
I'm missing something or it cannot be performed using autofs without
adding each entry explicitly for every users ?

-- 
Francesco P. Lovergine

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Looking for a per user submount...
  2008-01-28 10:11 Looking for a per user submount Francesco P. Lovergine
@ 2008-01-29  1:42 ` Ian Kent
  2008-01-29 14:27   ` Douglas E. Engert
  2008-01-29 15:26   ` Stef Bon
  0 siblings, 2 replies; 7+ messages in thread
From: Ian Kent @ 2008-01-29  1:42 UTC (permalink / raw)
  To: Francesco P. Lovergine; +Cc: autofs


On Mon, 2008-01-28 at 11:11 +0100, Francesco P. Lovergine wrote:
> I was looking for some sort of automounting for per-user subtrees.
> Essentially I need to bind-mount on demand some per user (users are sql-based)
> subdir like /path/<user>/mount_point, where /path/<user> is a true dir. 
> I'm missing something or it cannot be performed using autofs without
> adding each entry explicitly for every users ?

Try something like.

In the master map:
/topdir		/etc/auto.users

In auto.users:
*	:/path/&

Clearly, the automount entries for future mounts aren't known until they
are triggered, so they can't be seen no matter what options you use.

Ian

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Looking for a per user submount...
  2008-01-29  1:42 ` Ian Kent
@ 2008-01-29 14:27   ` Douglas E. Engert
  2008-01-29 14:33     ` Francesco Paolo Lovergine
  2008-01-29 15:26   ` Stef Bon
  1 sibling, 1 reply; 7+ messages in thread
From: Douglas E. Engert @ 2008-01-29 14:27 UTC (permalink / raw)
  To: Francesco P. Lovergine; +Cc: autofs



Ian Kent wrote:
> On Mon, 2008-01-28 at 11:11 +0100, Francesco P. Lovergine wrote:
>> I was looking for some sort of automounting for per-user subtrees.
>> Essentially I need to bind-mount on demand some per user (users are sql-based)
>> subdir like /path/<user>/mount_point, where /path/<user> is a true dir. 
>> I'm missing something or it cannot be performed using autofs without
>> adding each entry explicitly for every users ?

Have you looked at using an executable map? Something like in the master map:
/topdir   program:/etc/auto_per_user

/etc/auto_per_user:
#!/bin/sh
# $1 is <user>
echo ":/path/$1/mount_point"

> 
> Try something like.
> 
> In the master map:
> /topdir		/etc/auto.users
> 
> In auto.users:
> *	:/path/&
> 
> Clearly, the automount entries for future mounts aren't known until they
> are triggered, so they can't be seen no matter what options you use.
> 
> Ian
> 
> 
> _______________________________________________
> autofs mailing list
> autofs@linux.kernel.org
> http://linux.kernel.org/mailman/listinfo/autofs
> 
> 

-- 

  Douglas E. Engert  <DEEngert@anl.gov>
  Argonne National Laboratory
  9700 South Cass Avenue
  Argonne, Illinois  60439
  (630) 252-5444

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Looking for a per user submount...
  2008-01-29 14:27   ` Douglas E. Engert
@ 2008-01-29 14:33     ` Francesco Paolo Lovergine
  2008-01-29 15:23       ` Douglas E. Engert
  0 siblings, 1 reply; 7+ messages in thread
From: Francesco Paolo Lovergine @ 2008-01-29 14:33 UTC (permalink / raw)
  To: autofs

On Tue, Jan 29, 2008 at 08:27:09AM -0600, Douglas E. Engert wrote:
>
>
> Ian Kent wrote:
>> On Mon, 2008-01-28 at 11:11 +0100, Francesco P. Lovergine wrote:
>>> I was looking for some sort of automounting for per-user subtrees.
>>> Essentially I need to bind-mount on demand some per user (users are sql-based)
>>> subdir like /path/<user>/mount_point, where /path/<user> is a true 
>>> dir. I'm missing something or it cannot be performed using autofs 
>>> without
>>> adding each entry explicitly for every users ?
>
> Have you looked at using an executable map? Something like in the master map:
> /topdir   program:/etc/auto_per_user
>
> /etc/auto_per_user:
> #!/bin/sh
> # $1 is <user>
> echo ":/path/$1/mount_point"
>

Is this an autofs5-only feature? That could be useful I think...

-- 
Francesco P. Lovergine

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Looking for a per user submount...
  2008-01-29 14:33     ` Francesco Paolo Lovergine
@ 2008-01-29 15:23       ` Douglas E. Engert
  2008-02-04 15:57         ` Jeff Moyer
  0 siblings, 1 reply; 7+ messages in thread
From: Douglas E. Engert @ 2008-01-29 15:23 UTC (permalink / raw)
  To: autofs



Francesco Paolo Lovergine wrote:
> On Tue, Jan 29, 2008 at 08:27:09AM -0600, Douglas E. Engert wrote:
>>
>> Ian Kent wrote:
>>> On Mon, 2008-01-28 at 11:11 +0100, Francesco P. Lovergine wrote:
>>>> I was looking for some sort of automounting for per-user subtrees.
>>>> Essentially I need to bind-mount on demand some per user (users are sql-based)
>>>> subdir like /path/<user>/mount_point, where /path/<user> is a true 
>>>> dir. I'm missing something or it cannot be performed using autofs 
>>>> without
>>>> adding each entry explicitly for every users ?
>> Have you looked at using an executable map? Something like in the master map:
>> /topdir   program:/etc/auto_per_user
>>
>> /etc/auto_per_user:
>> #!/bin/sh
>> # $1 is <user>
>> echo ":/path/$1/mount_point"
>>
> 
> Is this an autofs5-only feature? That could be useful I think...

No, works with autofs 4 and on Solaris. On Solaris you don't use the "program:"
it checks the exec bits on the file instead.

See man page for automount(8) under map-type program
> 

-- 

  Douglas E. Engert  <DEEngert@anl.gov>
  Argonne National Laboratory
  9700 South Cass Avenue
  Argonne, Illinois  60439
  (630) 252-5444

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Looking for a per user submount...
  2008-01-29  1:42 ` Ian Kent
  2008-01-29 14:27   ` Douglas E. Engert
@ 2008-01-29 15:26   ` Stef Bon
  1 sibling, 0 replies; 7+ messages in thread
From: Stef Bon @ 2008-01-29 15:26 UTC (permalink / raw)
  To: autofs

Ian Kent wrote:
> On Mon, 2008-01-28 at 11:11 +0100, Francesco P. Lovergine wrote:
>   
>> I was looking for some sort of automounting for per-user subtrees.
>> Essentially I need to bind-mount on demand some per user (users are sql-based)
>> subdir like /path/<user>/mount_point, where /path/<user> is a true dir. 
>> I'm missing something or it cannot be performed using autofs without
>> adding each entry explicitly for every users ?
>>     
>
> Try something like.
>
> In the master map:
> /topdir		/etc/auto.users
>
> In auto.users:
> *	:/path/&
>
> Clearly, the automount entries for future mounts aren't known until they
> are triggered, so they can't be seen no matter what options you use.
>
> Ian
>   
I've been working on a construction to achieve mounts on a per-user basis.
It's based on a few things:

- a tree in the homedirectory of the logged in user, representing the
Windows network. The shares are
symlinks pointing to the automount path: /mnt/autofs/network/:

/home/sbon/Global Network/Windows Network/BONONLINE/LFS20060812/public ->

    /mnt/autofs/network/smb:%%u_sbon@LFS20060812@BONONLINE%public


Now this autofs directory/key (/smb::%%u_sbon@LFS20060812@BONONLINE%public)
does have all the information in it necessary to do a cifs mount.
I can do this because the automounter does not understand the smb
protocol. It just passes the parameters
to the mount program.

Earlier I've been working with a construction where the automounter had
to be started for every user. This new construction does not need this.

Futher this Windows Network representation is build by scripts which
discover the network periodically.

- my auto file looks like:

* -fstype=network :/&

Very short and simple!
Earlier I've been working with submounts ( Ian do you remember this?)

Look at the filesystem network. It does not exist, but I've created a
mount.network wrapper:

- a mount.network wrapper. It's just possible to use this wrapper in
stead of a "normal" filesystem!!
This wrapper does find all the information necessay out of the key
(/smb::%%u_user@HOST@WORKGROUP%share)  to call the real mounter mount.cifs!

The automounter is started at boottime with a rc script.
There is only one point which is difficult: for which users the network
representation has to be build.
Any advice appreciated. I'm using a special module in PAM for that
purpose right now, but maybe
there are other ways to do this.

My most recent howto is on:

http://linux.bononline.nl/linux/automountsmbshares/automountsmbshares-page01a.php

An older version is available at:

http://www.howtoforge.com/automatic_discovery_mounting_smb_networkshares

This latest version I will update as soon as I'm ready with the
documentation on my own website.

This construction is working very good. Try it. If you need any help you
can contact me.

Stef Bon




>
> _______________________________________________
> autofs mailing list
> autofs@linux.kernel.org
> http://linux.kernel.org/mailman/listinfo/autofs
>
>   

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Looking for a per user submount...
  2008-01-29 15:23       ` Douglas E. Engert
@ 2008-02-04 15:57         ` Jeff Moyer
  0 siblings, 0 replies; 7+ messages in thread
From: Jeff Moyer @ 2008-02-04 15:57 UTC (permalink / raw)
  To: Douglas E. Engert; +Cc: autofs

"Douglas E. Engert" <deengert@anl.gov> writes:

> Francesco Paolo Lovergine wrote:
>> On Tue, Jan 29, 2008 at 08:27:09AM -0600, Douglas E. Engert wrote:
>>>
>>> Ian Kent wrote:
>>>> On Mon, 2008-01-28 at 11:11 +0100, Francesco P. Lovergine wrote:
>>>>> I was looking for some sort of automounting for per-user subtrees.
>>>>> Essentially I need to bind-mount on demand some per user (users are sql-based)
>>>>> subdir like /path/<user>/mount_point, where /path/<user> is a true 
>>>>> dir. I'm missing something or it cannot be performed using autofs 
>>>>> without
>>>>> adding each entry explicitly for every users ?
>>> Have you looked at using an executable map? Something like in the master map:
>>> /topdir   program:/etc/auto_per_user
>>>
>>> /etc/auto_per_user:
>>> #!/bin/sh
>>> # $1 is <user>
>>> echo ":/path/$1/mount_point"
>>>
>> 
>> Is this an autofs5-only feature? That could be useful I think...
>
> No, works with autofs 4 and on Solaris. On Solaris you don't use the "program:"
> it checks the exec bits on the file instead.

You don't need to specify the mount type for the Linux automounter,
either.

Cheers,

Jeff

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-02-04 15:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-28 10:11 Looking for a per user submount Francesco P. Lovergine
2008-01-29  1:42 ` Ian Kent
2008-01-29 14:27   ` Douglas E. Engert
2008-01-29 14:33     ` Francesco Paolo Lovergine
2008-01-29 15:23       ` Douglas E. Engert
2008-02-04 15:57         ` Jeff Moyer
2008-01-29 15:26   ` Stef Bon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.