David B. wrote:
trying to get postgres to start up at boot. found this at postgresql's site

On OpenBSD, add the following lines to the file /etc/rc.local:

if [ -x /usr/local/pgsql/bin/pg_ctl -a -x /usr/local/pgsql/bin/postmaster ]; then su - -c '/usr/local/pgsql/bin/pg_ctl start -l /var/postgresql/log -s' postgres
   echo -n ' postgresql'
fi

my pg_ctl and postmaster executables are at /usr/local/bin, and have modified
the script accordingly.  my script reads as follows:

if [ -x /usr/local/bin/pg_ctl -a -x /usr/local/bin/postmaster ]; then
 su - -c '/usr/local/bin/pg_ctl -D /WEBSITE/DATADIRECTORY start' postgres
fi

at boot the error thrown is "No such login class: /usr/local/bin/pg_ctl -D /WEBSITE/DATADIRECTORY start"

the command I usually use after su'ing into postgres is:

pg_ctl -D /WEBSITE/DATADIRECTORY start

as /usr/local/bin is obviously in my PATH.

Any Ideas?

thanks

Hi,

My rc.local has this:

# PostgreSQL DB
if [ -x /usr/local/bin/pg_ctl ]; then
       su -l _postgresql -c "nohup /usr/local/bin/pg_ctl start \
               -D /var/postgresql/data -l /var/postgresql/logfile \
               -o '-D /var/postgresql/data'"
       echo ' postgresql '
fi

and I have created the user _postgresql to run the RDBMS.

HTH

Fred
--
OpenBSD on the Zaurus C3200
http://www.crowsons.net/puters/zaurus.php

Reply via email to