Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 157212 - postgres init script does not support configuration of postgres with syslog logging [PATCH]
Summary: postgres init script does not support configuration of postgres with syslog l...
Status: RESOLVED DUPLICATE of bug 44468
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-05 05:26 UTC by Mike Mattie
Modified: 2006-12-05 11:53 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Mattie 2006-12-05 05:26:14 UTC
I configured postgres to log through syslog. Unfortunately the postgres init
script is hard-coded for postgres logging only. when a empty string is passed
to pg_ctl with the -l option postgres fails to start.

I made a simple patch to the init script that supports syslog as an example. I
tested it in the syslog configuration and postgres now starts correctly. I
did not test with regular postgres logging.

--- /etc/init.d/postgresql.backup       2006-12-05 05:14:32.000000000 -0800
+++ /etc/init.d/postgresql      2006-12-05 05:18:40.000000000 -0800
@@ -26,7 +26,13 @@
                rm -f "$PGDATA/postmaster.pid"
        fi

-       su - $PGUSER -c "/usr/bin/pg_ctl start -D '$PGDATA' -s -l '$PGLOG' -o '$PGOPTS'"
+        LOG_ARGS="";
+
+       if [ "$PGLOG" != "syslog" ] ; then
+                LOG_ARGS="-l \'$PGLOG\'"
+        fi
+
+       su - $PGUSER -c "/usr/bin/pg_ctl start -D '$PGDATA' -s $LOG_ARGS -o '$PGOPTS'"

        while :
        do
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-12-05 11:53:24 UTC

*** This bug has been marked as a duplicate of 44468 ***