Re: Eliminating start error message: "unary operator

From: "Carlos Oliva" <carlos(at)pbsinet(dot)com>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Carlos" <Carlos(at)pbsinet(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>, "Dain" <Dain(at)pbsinet(dot)com>
Subject: Re: Eliminating start error message: "unary operator
Date: 2003-06-24 17:56:34
Message-ID: E148BE531B8AD311922E005004D3EEA1010F1E0F@xchserver.pbsinet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Tom,
Thank you very much for your help. In order to get the pg_ctl trace at
start up, I would appreciate it if you could advise me on how to modify
the postscrpt script. The line in question in the script is:
su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA -p
/usr/bin/postmaster -o '-p ${PGPORT}' start > /dev/null 2>&1" <
/dev/null

Should it be something like:
su -l postgres -s /bin/sh -c "/bin/sh -x /usr/bin/pg_ctl -D $PGDATA -p
/usr/bin/postmaster -o '-p ${PGPORT}' start > mylog 2>&1" < /dev/null

Thanks in advance for your response.

-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Tom Lane
Sent: Tuesday, June 24, 2003 10:32 AM
To: Carlos
Cc: pgsql-general(at)postgresql(dot)org; Dain
Subject: Re: [GENERAL] Eliminating start error message: "unary operator

"Carlos Oliva" <carlos(at)pbsinet(dot)com> writes:
> This log has the error but I do not understand why it occurs.

> Starting postgresql service: + su -l postgres -s /bin/sh -c
> '/usr/bin/pg_ctl -D /var/lib/pgsql/data -p /usr/bin/postmaster -o
> '\''-p 5432'\'' start > /dev/null 2>&1'
> -sh: [: ==: unary operator expected

Hm. Apparently the error is actually occuring inside the pg_ctl script.
Try changing the above line in the initscript to do
/bin/sh -c "/bin/sh -x /usr/bin/pg_ctl ..."
so we can get tracing of the pg_ctl script too.

(I am now thinking that the error probably occurs because pg_ctl is
expecting some environment variable to be set that is not set when run
from the boot script? If so, you might not see the failure if you try
to run pg_ctl by hand with sh -x. But you could try that first if you
like.)

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Browse pgsql-general by date

  From Date Subject
Next Message Ernest E Vogelsinger 2003-06-24 18:07:37 Re: Database design problem: multilingual strings
Previous Message Karsten Hilbert 2003-06-24 17:54:41 warning: long, Re: Database design problem: multilingual strings