All of lore.kernel.org
 help / color / mirror / Atom feed
* Using autofs with on non-mounted directory
@ 2009-08-19 14:18 Lukas Haase
  2009-08-28 14:49 ` Jeff Moyer
  0 siblings, 1 reply; 4+ messages in thread
From: Lukas Haase @ 2009-08-19 14:18 UTC (permalink / raw)
  To: autofs

Hi,

I have the problem that I have an indirect mount in 
"/var/lib/vz/root/500/media/media". Unfortunately this directory does 
not always exists (particulary not on system startup).

The directory exists as soon as another filesystem 
"/var/lib/vz/root/500" is mounted. I have the possibility to execute a 
script when that filesystem is mounted and umounted.

Do I have the possibility to add/remove this indirect mount somehow "on 
the fly"?

So I would start autofs without that particular indirect mount and add 
it only as soon as /var/lib/vz/root/500 is mounted. Before it is 
unmounted, the indirect mount could be removed as well.

Regards,
Luke

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

* Re: Using autofs with on non-mounted directory
  2009-08-19 14:18 Using autofs with on non-mounted directory Lukas Haase
@ 2009-08-28 14:49 ` Jeff Moyer
  2009-08-28 16:01   ` Lukas Haase
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Moyer @ 2009-08-28 14:49 UTC (permalink / raw)
  To: Lukas Haase; +Cc: autofs

Lukas Haase <lukashaase@gmx.at> writes:

> Hi,
>
> I have the problem that I have an indirect mount in
> "/var/lib/vz/root/500/media/media". Unfortunately this directory does
> not always exists (particulary not on system startup).

So it doesn't get mounted automatically?  If it *is* mounted as part of
startup, then it sounds like you just need to move that sooner in your
boot order.

> The directory exists as soon as another filesystem
> "/var/lib/vz/root/500" is mounted. I have the possibility to execute a
> script when that filesystem is mounted and umounted.

> Do I have the possibility to add/remove this indirect mount somehow
> "on the fly"?

You would have to script this yourself.  There is no real api to tell
the automounter to add map entries.

Cheers,
Jeff

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

* Re: Using autofs with on non-mounted directory
  2009-08-28 14:49 ` Jeff Moyer
@ 2009-08-28 16:01   ` Lukas Haase
  2009-08-31  3:44     ` Ian Kent
  0 siblings, 1 reply; 4+ messages in thread
From: Lukas Haase @ 2009-08-28 16:01 UTC (permalink / raw)
  To: autofs

Jeff Moyer schrieb:
> Lukas Haase <lukashaase@gmx.at> writes:
>> Hi,

Hi,

>> I have the problem that I have an indirect mount in
>> "/var/lib/vz/root/500/media/media". Unfortunately this directory does
>> not always exists (particulary not on system startup).
> 
> So it doesn't get mounted automatically?  If it *is* mounted as part of
> startup, then it sounds like you just need to move that sooner in your
> boot order.

No, that would be easy, of course. The actual problem is, that I want to 
have the indirect mount into an OpenVZ container. OpenVZ "bind mounts" 
its data root into the directory above before starting a container: 
/var/lib/vz/private/500/media/media --> /var/lib/vz/root/500/media/media.

And of course, the container is not always started. But I can call a 
script when starting/stopping a container.

>> The directory exists as soon as another filesystem
>> "/var/lib/vz/root/500" is mounted. I have the possibility to execute a
>> script when that filesystem is mounted and umounted.
> 
>> Do I have the possibility to add/remove this indirect mount somehow
>> "on the fly"?
> 
> You would have to script this yourself.  There is no real api to tell
> the automounter to add map entries.

Yes, but how?

Would it be possible to change the config files and send e.g. a HUP ?

That way, I could dynamically add the apropriate line on container 
startup and issue HUP, and remove the line when the container shuts down.

Regards,
Luke

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

* Re: Using autofs with on non-mounted directory
  2009-08-28 16:01   ` Lukas Haase
@ 2009-08-31  3:44     ` Ian Kent
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Kent @ 2009-08-31  3:44 UTC (permalink / raw)
  To: Lukas Haase; +Cc: autofs

Lukas Haase wrote:
> Jeff Moyer schrieb:
>> Lukas Haase <lukashaase@gmx.at> writes:
>>> Hi,
> 
> Hi,
> 
>>> I have the problem that I have an indirect mount in
>>> "/var/lib/vz/root/500/media/media". Unfortunately this directory does
>>> not always exists (particulary not on system startup).
>>
>> So it doesn't get mounted automatically?  If it *is* mounted as part of
>> startup, then it sounds like you just need to move that sooner in your
>> boot order.
> 
> No, that would be easy, of course. The actual problem is, that I want to
> have the indirect mount into an OpenVZ container. OpenVZ "bind mounts"
> its data root into the directory above before starting a container:
> /var/lib/vz/private/500/media/media --> /var/lib/vz/root/500/media/media.
> 
> And of course, the container is not always started. But I can call a
> script when starting/stopping a container.
> 
>>> The directory exists as soon as another filesystem
>>> "/var/lib/vz/root/500" is mounted. I have the possibility to execute a
>>> script when that filesystem is mounted and umounted.
>>
>>> Do I have the possibility to add/remove this indirect mount somehow
>>> "on the fly"?
>>
>> You would have to script this yourself.  There is no real api to tell
>> the automounter to add map entries.
> 
> Yes, but how?
> 
> Would it be possible to change the config files and send e.g. a HUP ?

Yep, HUP tells autofs to re-read it's maps.

> 
> That way, I could dynamically add the apropriate line on container
> startup and issue HUP, and remove the line when the container shuts down.
> 
> Regards,
> Luke
> 
> _______________________________________________
> autofs mailing list
> autofs@linux.kernel.org
> http://linux.kernel.org/mailman/listinfo/autofs

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

end of thread, other threads:[~2009-08-31  3:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-19 14:18 Using autofs with on non-mounted directory Lukas Haase
2009-08-28 14:49 ` Jeff Moyer
2009-08-28 16:01   ` Lukas Haase
2009-08-31  3:44     ` Ian Kent

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.