From owner-freebsd-hackers@freebsd.org Mon Feb 15 21:42:09 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EEE6AA8917 for ; Mon, 15 Feb 2016 21:42:09 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 2E733982 for ; Mon, 15 Feb 2016 21:42:09 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 2D49AAA8916; Mon, 15 Feb 2016 21:42:09 +0000 (UTC) Delivered-To: hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1479BAA8915 for ; Mon, 15 Feb 2016 21:42:09 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A127897D for ; Mon, 15 Feb 2016 21:42:08 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x22c.google.com with SMTP id g62so126271543wme.0 for ; Mon, 15 Feb 2016 13:42:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=dgyGnMm6KUVC3pGaWu2fMB5u7Ndyx/HxtihdeeKoh8Y=; b=iwLgozqmfm9WYBHPYePVh3qQIZDqNfC/CX/cb1WNIce4QJABaRgHZIy/qza1uNc1gV xe1h+Ykmd/Q+gpBp2O1MtqpcYrfpWPOStsVAqADWJ97+vkdNROtubUg5UVRrBtl1PHaa /AqKG3vJOykmqpBQfW9sbZXjsVnKJu1ksZvZq5YugjJNkuuxquaHij3MvARoCu7vk0ZO R4DhmuKp93wNp4jY7s8XUqL4hrwzexIssqOqXNlmAr9zn6Q7kQy7eynxVn6YuQNEwhJQ dwa39LspwIjiyIZG/Y2Bd9FmgOCFyhtUzHoKOY9mV55nJxzcdUdTcoAcRnZqoeqbY38J aYKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=dgyGnMm6KUVC3pGaWu2fMB5u7Ndyx/HxtihdeeKoh8Y=; b=lMttEUu0Zwlya24LMh6BQKuBIYRNYLJrgjnrLmq4lBG/Tu5lYp/nN7/fDQDn/Th3XL QwOxyBUFLhAKWI0MRK7BFc7JUE76DuGzplLED3FU06csiflGMiP2XDKBRRcM0RwEK4PK VD16exIsbf5c3djor3MA6xQ55DYXNd2sUJsNxhJWKzqXkU2VTzyc9RMtUjykflB2yG2g GvxBpvBed6vYUxPF+XLaZZDUjbITyBSgosmOclDLJO/eNttkdKScsprXwQvyDE4ozV4J TUYZVzo9H/HHRMZ6VS73Xx7gObur7/1uL+YROZ7wu+VbMXvEz4qGrZtGfw37jIU15na0 I5tg== X-Gm-Message-State: AG10YOQRcFVJPFiKAAbdmJmIgazlx94QaqEvDMTLNdSv91RfSiPBefLe0mlw+qoNPIeXJw== X-Received: by 10.194.47.133 with SMTP id d5mr20002707wjn.87.1455572526608; Mon, 15 Feb 2016 13:42:06 -0800 (PST) Received: from brick.home (49.44.broadband2.iol.cz. [83.208.44.49]) by smtp.gmail.com with ESMTPSA id gt7sm27236453wjc.1.2016.02.15.13.42.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Feb 2016 13:42:05 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Mon, 15 Feb 2016 22:41:59 +0100 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Daniel Braniss Cc: "hackers@freebsd.org" Subject: Re: autofs problem Message-ID: <20160215214159.GA6160@brick.home> References: <39973B1A-BBB9-4CB7-B352-A42C14B61E0F@cs.huji.ac.il> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <39973B1A-BBB9-4CB7-B352-A42C14B61E0F@cs.huji.ac.il> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2016 21:42:09 -0000 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.