Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Feb 2016 12:00:59 +0200
From:      Daniel Braniss <danny@cs.huji.ac.il>
To:        =?utf-8?Q?Edward_Tomasz_Napiera=C5=82a?= <trasz@FreeBSD.org>
Cc:        "hackers@freebsd.org" <hackers@freebsd.org>
Subject:   Re: autofs problem
Message-ID:  <6FFA90F6-7870-40B6-8BDE-281B899B62D7@cs.huji.ac.il>
In-Reply-To: <20160215214159.GA6160@brick.home>
References:  <39973B1A-BBB9-4CB7-B352-A42C14B61E0F@cs.huji.ac.il> <20160215214159.GA6160@brick.home>

next in thread | previous in thread | raw e-mail | index | archive | help


> On 15 Feb 2016, at 23:41, Edward Tomasz Napierała <trasz@FreeBSD.org> wrote:
> 
> On 0214T1655, Daniel Braniss wrote:
>> Hi,
>> I’m converting our (very) old am-utils maps to use the new autofs,
>> so I wrote a python script that queries the am-utils map, and ‘generates’
>> one that autofs likes.
>> so autofs_master has:
>> …
>> /cs	auto_cs
>> 
>> auto_cs is a python script and is executable.
>> 
>> at the moment I’m stuck with what am-utils  type=link
>> so I’m using -fstype=nullfs :/cs/some-path, but before this can work I need
>> to trigger autofs with the /cs/some-path, so before the script returns I do a
>> 	os.stat('/cs/some-path')
>> but this returns an error, mainly because it is not caught by autofs!
>> doing the same in the command line works, and later the nullfs too, (i’m afraid
>> of what the auto unmount will do later, but that’s another issue)
>> 
>> is this by design? or is there some better way?
> 
> It's by design - basically, autofs(4) has code to explicitly disable triggering
> by anything running with the same SID (session id) as the automountd(8).  This
> is to prevent some obvious (and some less than obvious and quite hard to debug)
> deadlocks.  Thus, any script ran by automountd(8) works as if the autofs mounts
> "weren't there".
> 
> You might be able to work around this by somehow calling setsid() from
> the Python script before triggering.

bingo!, that did it

thanks,
	danny





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6FFA90F6-7870-40B6-8BDE-281B899B62D7>