On Mon, 23 Nov 1998, Jonah Kuo wrote:

> Hello,
> 
> First of all, I apologize if this has been discussed before.
> 
> I have this startup script 'pgsql.sh' on my FreeBSD-3.0 system,
> everything goes fine except I can't have error messages send to
> the file I specified in this script
> 
> #!/bin/sh
> [ -x /tmp/.s.PGSQL.* ] && rm -f /tmp/.s.PGSQL.*
> [ -x /usr/local/pgsql/bin/postmaster ] && {
>         su -l postgres -c 'exec
>     /usr/local/pgsql/bin/postmaster
>     -D/usr/local/pgsql/data
>     -S -o -F > /usr/local/pgsql/errlog' &
>     echo -n ' pgSQL'
> }
> 
> There was an /usr/local/pgsql/errlog opened, and the error messages are
> always
> send to console  regardless of specifying '-S' option or not.
> 
> Is there anybody encountered this before? any help would be grateful.

On this line:

-S -o -F > /usr/local/pgsql/errlog' &

Modify it to look like this:

-S -o -F 2>&1 > /usr/local/pgsql/errlog' &

Assuming this script runs through bash it will direct standard error
(stderr) to standard output (stdout).  All output will be sent to
/usr/local/pgsql/errlog.

Enjoy.
  -M@

-- 
Matthew Hixson - CIO              Linux, n;
FroZenWave Communications           the nouveau postmodern operating
http://www.frozenwave.com           system for the masses



Reply via email to