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

_________________________________________________________________
Stay in touch with old friends and meet new ones with Windows Live Spaces http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us


I think the -c before the user specifies a login class not a command. I use :

su _postgresql -c '/usr/local/bin/pg_ctl start -D /var/postgresql/data -l /var/postgresql/log -s'

Steve

Reply via email to