Forum OpenACS Q&A: PostgreSQL boot options

Collapse
Posted by Kurt Schwarz on
Just wanted some input as to boot options for my PostgreSQL server.

I like the way daemontools load the nsd, but what about the database
server?  I'd like to have it monitored...but is it a good idea?  Would
the benefits of loading via the tools outweight loading it via inti.d?

If I decide to run it via daemontools, how would I set up the run
file?

Thanks in advance.

Collapse
Posted by Jon Griffin on
I use daemontools for almost everything (except crappy daemons that do thier own thing i.e. apache).

I will upload a doc on setting up PG with svc later when I get home. It is easy and more reliable.

Collapse
Posted by Guan Yang on
You can use daemontools to monitor servers that refuse to stay in the foreground with the included fghack program. It opens up a ton of file descriptors to a pipe before forking, and only exists when all of the ofiles have been closed.
Collapse
Posted by Jon Griffin on
I looked at that and have been lazy so I just run the few daemons that are written like crap the init.d way.
Collapse
Posted by Arjun Sanyal on
"Just wanted some input as to boot options for my PostgreSQL server.
I like the way daemontools load the nsd, but what about the database server?"

i'd say that's the way to go. once you get the djb religion there's no going back to "/sbin/init q"

here's the run script i use for pg:

#!/bin/sh
exec  su -c  "/usr/local/pgsql-7.2.2/bin/postmaster -D /foobar/pgsql-7.2.2/data" postgres

if it's not working for you, check the permissions on the dir and the script first..

Collapse
Posted by Tom Jackson on

Arjun, which options to svc are good for stopping, restarting, etc. the postmaster? I've heard postmaster is picky about this.

Collapse
Posted by Kurt Schwarz on
First...thanks to all for your assistance. I appreciate it.

Secondly, I did a bit of tweeking with with the basic run scripts. I wanted to make sure that both the PostgreSQL and Email were up and running before I brought up the AOLServer.

This is my work-around for it:

------------
#!/bin/sh

pid1=`/sbin/pidof -s postmaster`
pid2=`/sbin/pidof -s qmail-send`
pid3=`/sbin/pidof -s tcpserver`

if [ $pid1 ]
then
  if [ $pid2 ]
  then
    if [ $pid3 ]
    then
      sleep 15
      exec /usr/local/aolserver/bin/nsd -it /usr/local/aolserver/nsd.tcl -u nsadmin -g web
    fi
  fi
fi
------------

Hope this may be of some use to someone!