Subject: bin/27309: syslogd -u can't create pidfile
To: None <>
From: None <>
List: netbsd-bugs
Date: 10/21/2004 11:07:55
>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 UTC 2004
>Originator:     Jan Schaumann
>Release:        NetBSD 2.0_RC3
System: NetBSD 2.0_RC3 NetBSD 2.0_RC3 (BOCK) #20: Mon Oct 4 14:19:22 EDT 2004 i386
Architecture: i386
Machine: i386
	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/.

	syslogd_flags="-u syslogd -g syslogd"

	to /etc/rc.conf

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

	ls /var/run/
	ls: /var/run/ 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/
	Starting syslogd.
	syslogd: bind() failed: Address already in use
	syslogd: Fatal error, exiting


	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.