apache apachecon app apple asf atom atomprotocol atompub barcamprdu blogapps blogging businessblogging conferences family feeds foss general glassfish google humor ibm java javaone links linux mac microsoft movies music netbeans opensocial opensource photos politics rest roller rome rss socialnetworking socialsite socialsoftware sun triangle trianglebloggers vacation webdev webservices wiki


Tuesday May 25, 2004

Hatteras

Eric Sink: Microsoft's new enterprise-class source control tool was written from scratch by a team in the Raleigh-Durham area. The team is being led by Brian Harry, the guy who originally developed SourceSafe at OneTree before it was acquired by Microsoft.
So much for Vault. Seems to me, Eric made an error in choosing his competition.

PostgreSQL startup items for MacOS X

I followed the PostgreSQL installation instructions on Apple's site and got PostgreSQL up and running in no time. To make PostgreSQL start when MacOS starts, I had to do a little more work. I added a startup item as described in James Duncan Davidson's Running Mac OS X Panther. First, I created a startup item directory and used vi to create a parameters file:

root# mkdir -p /Library/StartupItems/PostgreSQL
root# cd /Library/StartupItems/PostgresSQL
root# vi StartupParameters.plist

Next, I guessed that PostgreSQL requires Directory Services and uses Disks and came up with this StartupParameters.plist file:

{
   Description = "PostgreSQL Server";
   Provides = ("PostgreSQL");
   Requires = ("DirectoryServices");
   Uses = ("Disks");
   OrderPreference = "None";
}

Finally, I wrote a startup script to start, restart, and stop PostgreSQL:

#!/bin/sh
. /etc/rc.common
StartService() {
   echo "Starting PostgreSQL"
   sudo -u postgres /usr/local/pgsql/bin/postmaster -i -D /var/postgres/rollerdb &
}
RestartService() {
   echo "Restarting PostgreSQL"
   sudo -u postgres /usr/local/pgsql/bin/pg_ctl -D /var/postgres/rollerdb stop
   sudo -u postgres /usr/local/pgsql/bin/postmaster -i -D /var/postgres/rollerdb &
}
StopService() {
   echo "Stopping PostgreSQL"
   sudo -u postgres /usr/local/pgsql/bin/pg_ctl -D /var/postgres/rollerdb stop
}
RunService "$1"

Once I was done with that I tested starting, restarting, and stopping PostgreSQL using the SystemStarter command. Once the script worked, I rebooted and found that PostgreSQL did indeed start on startup. It works, but I wonder, is this the best way to configure service for Mac OS X? Davidson's book menioned xinetd and mach bootstrap servers, but says that the SystemStarter is the way to go for now.

This work is licensed under a Creative Commons License.
Copyright 2002-2007, David M Johnson (dave.johnson at rollerweblogger.org)

This is a personal weblog, I do not speak for my employer.