From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 27 07:31:28 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 D45A016A4B3 for ; Mon, 27 Oct 2003 07:31:28 -0800 (PST) Received: from bast.unixathome.org (bast.unixathome.org [66.11.174.150]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2122143FE0 for ; Mon, 27 Oct 2003 07:31:24 -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 D9FC13D34 for ; Mon, 27 Oct 2003 10:31:18 -0500 (EST) From: "Dan Langille" To: freebsd-hackers@freebsd.org Date: Mon, 27 Oct 2003 10:31:18 -0500 MIME-Version: 1.0 Message-ID: <3F9CF3F6.8307.ABC1250@localhost> Priority: normal X-mailer: Pegasus Mail for Windows (v4.02a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body Subject: 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 15:31:28 -0000 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. Any suggestions? -- Dan Langille : http://www.langille.org/