From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 27 08:48:32 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4E70A16A4B3 for ; Mon, 27 Oct 2003 08:48:32 -0800 (PST) Received: from bast.unixathome.org (bast.unixathome.org [66.11.174.150]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9A44B43FBF for ; Mon, 27 Oct 2003 08:48:31 -0800 (PST) (envelope-from dan@langille.org) Received: from wocker (wocker.unixathome.org [192.168.0.99]) by bast.unixathome.org (Postfix) with ESMTP id A81073D28; Mon, 27 Oct 2003 11:48:30 -0500 (EST) From: "Dan Langille" To: Oliver Eikemeier Date: Mon, 27 Oct 2003 11:48:30 -0500 MIME-Version: 1.0 Message-ID: <3F9D060E.26143.B02C07F@localhost> Priority: normal In-reply-to: <3F9D4A45.8070400@fillmore-labs.com> References: <3F9CF3F6.8307.ABC1250@localhost> X-mailer: Pegasus Mail for Windows (v4.02a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body cc: freebsd-hackers@freebsd.org Subject: Re: non-root process and PID files X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2003 16:48:32 -0000 On 27 Oct 2003 at 17:39, Oliver Eikemeier wrote: > Dan Langille wrote: > > > If a process starts up and does a setuid, should it be writing the > > PID file before or after the setuid? > > > > Two methods exists AFAIK: > > > > 1 - write your PID immediately, and the file is chown root:wheel > > 2 - write your PID to /var/run/myapp/myapp.pid where /var/run/myapp/ > > is chown myapp:myapp > > > > Of the two, I think #1 is cleaner as it does not require another > > directory with special permissions. > > You may have problems removing the file on exit, though. The plan was to not remove it. -- Dan Langille : http://www.langille.org/