From owner-freebsd-hackers Mon May 27 11:54:43 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from empty1.ekahuna.com (empty1.ekahuna.com [198.144.200.196]) by hub.freebsd.org (Postfix) with ESMTP id CA65637B40A for ; Mon, 27 May 2002 11:54:39 -0700 (PDT) Received: from pc-02 (pc02.ekahuna.com [198.144.200.197]) by empty1.ekahuna.com (Post.Office MTA v3.5.3 release 223 ID# 0-0U10L2S100V35) with ESMTP id com; Mon, 27 May 2002 11:54:39 -0700 From: "Philip J. Koenig" Organization: The Electric Kahuna Organization To: freebsd-hackers@FreeBSD.ORG Date: Mon, 27 May 2002 11:54:39 -0700 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: non-root /var/run files (was Re: Sendmail, smmsp, and pid file) Reply-To: pjklist@ekahuna.com Cc: Lyndon Nerenberg , Claus Assmann In-reply-to: <200205271824.g4RIOutI008910@orthanc.ab.ca> References: Your message of "Mon, 27 May 2002 08:10:26 PDT." <20020527081026.B29438@zardoc.esmtp.org> X-mailer: Pegasus Mail for Win32 (v3.12c) Message-ID: <20020527185439041.AAA472@empty1.ekahuna.com@pc02.ekahuna.com> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 27 May 2002, at 12:24, Lyndon Nerenberg boldly uttered: > [Redirecting to the hackers list -- please respect the reply-to header] Sigh, well I guess I have another reason to join that list, what the heck.. > >>>>> "Claus" == Claus Assmann writes: > > Claus> On Mon, May 27, 2002, Philip J. Koenig wrote: > >> Any particular reason why the sendmail with 4.6-RC is writing sm- > >> client.pid into /var/spool/clientmqueue instead of /var/run? > > Claus> Permissions. > > This points out a short-fall in the /var/run scheme: it can only be used > by processes running with an euid of 0 at the time they create the file. > > If we have a /var/run/sendmail directory owned by the smmsp user then > sendmail can create its pid files there. Likewise for bind. The purgedir > function in /etc/rc (used to clean /var/run) will preserve the existing > directory structure under /var/run, so the sub-directory tree will > survive reboots. > > --lyndon Funny thing about that, I actually created a /var/run/named directory for just the purpose of running named in a 'sandbox', chowned the directory bind:bind, and because I forgot to set the pid file path in named.conf, I see that it seems to write named.pid (owned by bind:bind) into /var/run without a problem. I know some processes "demote" themselves after they initialize, maybe this is what the named daemon does. But you wouldn't know it, given the ownership of the pid file. (I'm sure this makes sense to people who know about this stuff, it still confuses me) Maybe the daemon creates the file as root than chown's it? -- Philip J. Koenig pjklist@ekahuna.com Electric Kahuna Systems -- Computers & Communications for the New Millenium To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message