Forum OpenACS Q&A: How do I automate the startup and shutdown of postgres?

In https://openacs.org/doc/openacs/html/openacs-install-5.html, Don Baccus describes a little of how to automate the startup and shutdown of Postgres. He says to put a line like:
su -l postgres -c '/usr/local/pgsql/bin/postmaster -B 1000 -o "-S
2000" -S -D /usr/local/pgsql/data'
in your (red hat) /etc/rc.d/init.d/postgresql file. I probably need to chown root.root /etc/rc.d/init.d/postgresql and then chmod 700 /etc/rc.d/init.d/postgresql

I also probably should... chkconfig --add postgresql, right? I'm just concerned, because I thought (unfounded) that a init.d script had to respond to a start and stop argument.

How have all of you automated this?

Typically I just go into /etc/rc.d/init.d and copy script to postgresql and edit it so that it issues the postgres startup and stop commands.  Postgres is a little weird in this respect, because you actually start and stop the postmaster.  If you study several scripts in the /etc/rc.d/init.d directory, you'll probably understand pretty quickly how it should be done.
I put these lines in /etc/inittab in spite of someone telling me it shouldn't go there. But I haven't noticed any strange behavior.
# Run Postgresql 7.0.2
pg:2345:respawn:/bin/su - postgres -c "postmaster -i -B 1000 -o "-S 2000""
If you want to use the provided postgresql script that's in init.d, then, yes, you should go ahead and use chkconfig --add postgresql if you want it to start automatically on startup.

This is what I do, and it works fine on my two RH 6.1  systems.  On my RH 6.2 laptop, though, occassionally the script messes up and I've not taken the time to track it down.