NetBSD Problem Report #27309

From gnats-bugs-owner-gnats=mail-index.netbsd.org@gnats.NetBSD.org  Thu Oct 21 15:07:57 2004
Return-Path: <gnats-bugs-owner-gnats=mail-index.netbsd.org@gnats.NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.netbsd.org (Postfix) with SMTP id 3B258251ED6
	for <gnats@www.netbsd.org>; Thu, 21 Oct 2004 15:07:57 +0000 (UTC)
Message-Id: <20041021150755.4370E548E98@dogfish-head.cs.stevens.edu>
Date: Thu, 21 Oct 2004 11:07:55 -0400 (EDT)
From: jschauma@stevens-tech.edu
Reply-To: jschauma@stevens-tech.edu
To: gnats-bugs@gnats.NetBSD.org
Subject: syslogd -u can't create pidfile
X-Send-Pr-Version: 3.95

>Number:         27309
>Category:       bin
>Synopsis:       syslogd -u can't create pidfile
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 22 08:47:01 +0000 2004
>Closed-Date:    
>Last-Modified:  
>Originator:     Jan Schaumann
>Release:        NetBSD 2.0_RC3
>Organization:

>Environment:


System: NetBSD dogfish-head.cs.stevens.edu 2.0_RC3 NetBSD 2.0_RC3 (BOCK) #20: Mon Oct 4 14:19:22 EDT 2004 jschauma@doppelbock.hpcf.cs.stevens-tech.edu:/share/src/sys/arch/i386/compile/obj/BOCK i386
Architecture: i386
Machine: i386
>Description:
	When starting syslogd(8) with the '-u' option, syslogd will be unable
	to create the standard pidfile, as it changes UID and the user likely
	does not have write permission to /var/run/.
>How-To-Repeat:
	Add:

	syslogd=YES
	syslogd_flags="-u syslogd -g syslogd"

	to /etc/rc.conf

	/etc/rc.d/syslogd restart
	syslogd not running? (check /var/run/syslogd.pid).
	Starting syslogd.

	ls /var/run/syslogd.pid
	ls: /var/run/syslogd.pid: No such file or directory

	ps ax | grep sysl
	 8461 ?? Ss     0:00.00 /usr/sbin/syslogd -u syslogd -g syslogd

	/etc/rc.d/syslogd restart
	syslogd not running? (check /var/run/syslogd.pid).
	Starting syslogd.
	syslogd: bind() failed: Address already in use
	syslogd: Fatal error, exiting


>Fix:

	Well, create pidfile before changing UID.  However, there seems
	to be a problem:  syslogd.c around #464 indicates that we can't
	daemonize until we're sure we don't get any fatal errors.  So we
	can't daemonize until we've changed UID.  We can't create the pidfile
	before daemonizing, obviously, either.

>Release-Note:
>Audit-Trail:
>Unformatted:
 >Quarter:
 >Keywords:
 >Date-Required:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.