ports/103367: pglogd fails to start

Renaud Waldura renaud+freebsd at waldura.org
Mon Sep 18 21:00:38 UTC 2006


>Number:         103367
>Category:       ports
>Synopsis:       pglogd fails to start
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 18 21:00:34 GMT 2006
>Closed-Date:
>Last-Modified:
>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 at 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:
>Unformatted:



More information about the freebsd-ports-bugs mailing list