From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 27 07:37:21 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 A940B16A4B3 for ; Mon, 27 Oct 2003 07:37:21 -0800 (PST) Received: from mindfields.energyhq.es.eu.org (73.Red-213-97-200.pooles.rima-tde.net [213.97.200.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id A711543FAF for ; Mon, 27 Oct 2003 07:37:16 -0800 (PST) (envelope-from flynn@energyhq.es.eu.org) Received: from scienide.energyhq.es.eu.org (scienide.energyhq.es.eu.org [192.168.100.1]) by mindfields.energyhq.es.eu.org (Postfix) with SMTP id D55B735782; Mon, 27 Oct 2003 16:36:57 +0100 (CET) Date: Mon, 27 Oct 2003 16:36:58 +0100 From: Miguel Mendez To: "Dan Langille" Message-Id: <20031027163658.5d5af160.flynn@energyhq.es.eu.org> In-Reply-To: <3F9CF3F6.8307.ABC1250@localhost> References: <3F9CF3F6.8307.ABC1250@localhost> Organization: X-Mailer: Sylpheed version 0.9.5-gtk2-20030906 (GTK+ 2.2.4; i386-portbld-freebsd5.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 15:37:21 -0000 Dixitur illum "Dan Langille" scribere... Hi, > 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 OpenBSD seems to favor this approach, if that tells you something. [...] -rw-r--r-- 1 root wheel 6 Oct 10 21:17 mountd.pid -rw-r--r-- 1 root wheel 5 Oct 10 21:17 named.pid -rw-r--r-- 1 root wheel 20 Oct 12 22:13 nmbd.pid -rw-r--r-- 1 root wheel 5 Oct 10 21:17 ntpd.pid -rw-r--r-- 1 root wheel 6 Oct 10 21:17 pflogd.pid -rw-r--r-- 1 root wheel 5 Oct 11 10:15 rtadvd.pid -rw-r--r-- 1 root wheel 20 Oct 12 22:13 smbd.pid -rw-r--r-- 1 root wheel 6 Oct 10 21:17 sshd.pid -rw-r--r-- 1 root wheel 6 Oct 10 21:17 syslog.pid [...] > Of the two, I think #1 is cleaner as it does not require another > directory with special permissions. Agreed. Cheers, ---- Miguel Mendez http://www.energyhq.es.eu.org