From nobody@FreeBSD.org  Mon Sep 18 20:51:02 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 98DE416A415
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 18 Sep 2006 20:51:02 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id EFEFA43D82
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 18 Sep 2006 20:51:01 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k8IKp1xF022808
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 18 Sep 2006 20:51:01 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k8IKp1jU022807;
	Mon, 18 Sep 2006 20:51:01 GMT
	(envelope-from nobody)
Message-Id: <200609182051.k8IKp1jU022807@www.freebsd.org>
Date: Mon, 18 Sep 2006 20:51:01 GMT
From: Renaud Waldura <renaud+freebsd@waldura.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: pglogd fails to start
X-Send-Pr-Version: www-2.3

>Number:         103367
>Category:       ports
>Synopsis:       www/pglogd: pglogd fails to start
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pav
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 18 21:00:34 GMT 2006
>Closed-Date:    Tue Feb 20 15:36:04 GMT 2007
>Last-Modified:  Tue Feb 20 15:36:04 GMT 2007
>Originator:     Renaud Waldura
>Release:        6.1
>Organization:
>Environment:
FreeBSD ebola.biohz.net 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Sun May  7 04:42:56 UTC 2006     root@opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP  i386

>Description:
I'm using the pglogd port to record log entries from Apache to a Postgres database. This program works by opening a named pipe in /var/run, and reading log entries from it. Apache is configured to write logs into said pipe.

PORTNAME=       pglogd
PORTVERSION=    2.3
PORTREVISION=   1

At boot time, pglogd fails to start and says another instance may already be running. No such process exists. The file does indeed exist, but it's a regular file, instead of a named pipe.

To fix, I stop Apache, delete /var/run/pglogd_fifo, start pglogd with the RC script, and start Apache. All is well after that.

Here are my RC scripts:

total 24
-r-xr-xr-x  1 root  pgsql   1.5K Aug 26 18:47 010.pgsql.sh*
-r-xr-xr-x  1 root  wheel   757B Aug 27 15:12 110.sqlgrey.sh*
-r-xr-xr-x  1 root  wheel   440B Aug 27 21:43 120.pglogd.sh*
-r-xr-xr-x  1 root  wheel   715B Aug 26 18:33 apache.sh*
-r-xr-xr-x  1 root  wheel   1.5K Aug 26 19:03 courier-authdaemond*
-r-xr-xr-x  1 root  wheel   973B Aug 26 19:21 courier-imap-imapd-ssl.sh*
-r-xr-xr-x  1 root  wheel   912B Aug 26 19:21 courier-imap-imapd.sh*
-r-xr-xr-x  1 root  wheel   1.5K Aug 26 20:23 dnetc*
-r-xr-xr-x  1 root  wheel   1.0K Aug 27 15:53 postfix*
-r-xr-xr-x  1 root  wheel   4.4K Aug 28 23:27 tomcat55*

I would expect pglogd to start before Apache.

>How-To-Repeat:
1- Install Apache, Postgres, pglogd.

2- Configure Apache to log to plogd socket with:
LogFormat "%t %T %>s %b %m %v %h \"%U\" \"%{Referer}i\" \"%{User-agent}i\" \"%r\" %l %u" pglogd
CustomLog "/var/run/pglogd_fifo" pglogd

3- Create database for log entries (see pglogd documentation).

4- Configure database name in /usr/local/etc/pglogd.conf.

5- Verify log entries are written to database, reboot system.
>Fix:
I think this happens because Apache starts up before pglogd. Apache logs data to a regular file because the socket doesn't exist yet. Pglogd then refuses to start because a file exists where the socket should be. I have not verified this.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Mon Sep 18 21:25:31 UTC 2006 
State-Changed-Why:  
Awaiting maintainers feedback 

http://www.freebsd.org/cgi/query-pr.cgi?pr=103367 
State-Changed-From-To: feedback->open 
State-Changed-By: gabor 
State-Changed-When: Mon Dec 18 18:13:03 UTC 2006 
State-Changed-Why:  
Maintainer timeout. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=103367 
State-Changed-From-To: open->feedback 
State-Changed-By: pav 
State-Changed-When: Thu Jan 18 19:15:19 UTC 2007 
State-Changed-Why:  
Do you have a patch to fix this? Looks like maintainer is unavailable. 


Responsible-Changed-From-To: freebsd-ports-bugs->pav 
Responsible-Changed-By: pav 
Responsible-Changed-When: Thu Jan 18 19:15:19 UTC 2007 
Responsible-Changed-Why:  
Do you have a patch to fix this? Looks like maintainer is unavailable. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=103367 

From: "Renaud Waldura" <renaud+freebsd@waldura.org>
To: <bug-followup@FreeBSD.org>
Cc:  
Subject: Re: ports/103367: www/pglogd: pglogd fails to start
Date: Thu, 18 Jan 2007 16:09:06 -0800

 No patch at the moment, sorry. Is it not possible to control startup order 
 by naming scripts with numbers? It used to work in previous releases of 
 FreeBSD (4.x for sure).
 
 Thank you for following-up,
 
 --Renaud 
 
 

From: Pav Lucistnik <pav@FreeBSD.org>
To: Renaud Waldura <renaud+freebsd@waldura.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/103367: www/pglogd: pglogd fails to start
Date: Fri, 19 Jan 2007 10:52:53 +0100

 >  No patch at the moment, sorry. Is it not possible to control startup order 
 >  by naming scripts with numbers? It used to work in previous releases of 
 >  FreeBSD (4.x for sure).
 
 You should be using REQUIRES and PROVIDES feature of rc.subr system in
 FreeBSD 5 and newer.
 
 -- 
 Pav Lucistnik <pav@oook.cz>
               <pav@FreeBSD.org>
 
 Linux is a happy free-for-all chaos.
State-Changed-From-To: feedback->closed 
State-Changed-By: pav 
State-Changed-When: Tue Feb 20 15:35:36 UTC 2007 
State-Changed-Why:  
Feedback timeout (no activity for one month) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=103367 
>Unformatted:
