Thread: OpenBSD startup - logfile?
I've got the following line in /etc/rc.local on my OpenBSD 2.6 system: /usr/local/bin/pgwrap -o /var/pgsql/log postmaster -i -S -o -F >> /var/pgsql/postmaster.log Postgres starts ok, and /var/pgsql/postmaster.log gets created, but it stays at size=0. Where did I go wrong? Frank
Frank Bax <fbax@execulink.com> writes: > I've got the following line in /etc/rc.local on my OpenBSD 2.6 system: > /usr/local/bin/pgwrap -o /var/pgsql/log postmaster -i -S -o -F >> > /var/pgsql/postmaster.log > Postgres starts ok, and /var/pgsql/postmaster.log gets created, but it > stays at size=0. Remove -S switch. Might be a good idea to redirect postmaster's stderr into the logfile, as well as stdout. regards, tom lane
Thanks. When I remove -S then the command never completes? How do I redirect stderr? At 11:49 AM 10/17/00 -0400, you wrote: >Frank Bax <fbax@execulink.com> writes: >> I've got the following line in /etc/rc.local on my OpenBSD 2.6 system: >> /usr/local/bin/pgwrap -o /var/pgsql/log postmaster -i -S -o -F >> >> /var/pgsql/postmaster.log > >> Postgres starts ok, and /var/pgsql/postmaster.log gets created, but it >> stays at size=0. > >Remove -S switch. > >Might be a good idea to redirect postmaster's stderr into the logfile, >as well as stdout. > > regards, tom lane
Frank Bax <fbax@execulink.com> writes: > Thanks. When I remove -S then the command never completes? Oh, OK. It wasn't clear what context you were starting the postmaster in. Evidently it's from a script that has other things to do. You need to put an ampersand "&" at the end of the command line to fork off a separate process for the postmaster. I had mistakenly assumed your "pgwrap" thingy was doing something like that. > How do I redirect stderr? Depends what shell you're using, but on sh-derived shells adding 2>&1 after the >>file phrase will put stderr into the same file as stdout. regards, tom lane
Thanks! 2>&1 was already used in same script. pgwrap is an OpenBSD thing that sets pg environment for root user (I know a *little* bit about my system). Frank At 12:49 PM 10/17/00 -0400, you wrote: >Frank Bax <fbax@execulink.com> writes: >> Thanks. When I remove -S then the command never completes? > >Oh, OK. It wasn't clear what context you were starting the postmaster >in. Evidently it's from a script that has other things to do. You >need to put an ampersand "&" at the end of the command line to fork off >a separate process for the postmaster. I had mistakenly assumed your >"pgwrap" thingy was doing something like that. > >> How do I redirect stderr? > >Depends what shell you're using, but on sh-derived shells adding > 2>&1 >after the >>file phrase will put stderr into the same file as stdout. > > regards, tom lane
Here's my pgsql startup command (OpenBSD 2.6): /usr/local/bin/pgwrap -o /var/pgsql/log postmaster -i -o -F >> /var/pgsql/postmaster.log 2>&1 & When I run my PHP routine, I get this: Warning: PostgresSQL query failed: pqReadData() -- backend closed the channel unexpectedly. This probably means the backend terminated abnormally before or while processing the request. in db_pgsql.inc on line 52 Database error: Invalid SQL: INSERT INTO gedcom_grp (grpkey1,grpseq,grpkey2) VALUES('I0000016','1','F0000067') PostgreSQL Error: 1 (pqReadData() -- backend closed the channel unexpectedly. This probably means the backend terminated abnormally before or while processing the request. ) Session halted. The program is trying to do an initial load of three tables. It starts by deleting all rows in these three tables, then manages to add 13 rows to gedcom_grp before the above error. But both log files mentioned in the startup command are empty? Frank
Thanks! vacuum did get rid of those messages. The last time import/rebuild worked it took over 2hrs, now it's down to 30min! But the original problem ... I'm finally starting to get some log entries, but they are in /var/pgsql/log instead of /var/pgsql/postmaster.log - any ideas? probably an OpenBSd thing with pgwrap - I'll try an OpenBSD newsgroup. Frank At 08:48 AM 10/19/00 -0700, Jerry Tangren wrote: >Frank, I was also encountering those errors until >I began to regularly issue the vacuum on the database. >Haven't had any problems since. > >--Jerry <tangren@wsu.edu> > >At 09:37 AM 10/19/2000 -0400, you wrote: >>Here's my pgsql startup command (OpenBSD 2.6): >> >>/usr/local/bin/pgwrap -o /var/pgsql/log postmaster -i -o -F >> >>/var/pgsql/postmaster.log 2>&1 & >> >>When I run my PHP routine, I get this: >> >>Warning: PostgresSQL query failed: pqReadData() -- backend closed the >>channel unexpectedly. This probably means the backend terminated >>abnormally before or while processing the request. in db_pgsql.inc on >>line 52 >>Database error: Invalid SQL: INSERT INTO gedcom_grp >>(grpkey1,grpseq,grpkey2) VALUES('I0000016','1','F0000067') >>PostgreSQL Error: 1 (pqReadData() -- backend closed the channel >>unexpectedly. This probably means the backend terminated abnormally >>before or while processing the request. ) >>Session halted. >> >>The program is trying to do an initial load of three tables. It starts by >>deleting all rows in these three tables, then manages to add 13 rows to >>gedcom_grp before the above error. >> >>But both log files mentioned in the startup command are empty? >> >>Frank > > >