Forum OpenACS Q&A: Re: Keeping AolServer Alive on MacOS X

Collapse
Posted by Barry Books on
The following works for me in /Library/StartupItems/. I have not automated restarts in my run.sh file but I suspect
while true
do

/usr/local/aolserver/bin/nsd -b 0.0.0.0:80 -t /usr/local/aolserver/config.tcl -u postgres $*
sleep 10

done
would work. The sleep just keeps dumb things from happening.

Postgres Start

StartService ()
{
    if [ "${POSTGRES:=-NO-}" = "-YES-" ]; then
            ConsoleMessage "Starting postgres database services"
            su - postgres -c "/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data/ start -o \"-i\""
    fi
}

Postgres Plist
{
  Description   = "Postgres Database server";
  Provides      = ("PSQL");
  Requires      = ("Resolver");
  Uses          = ("Network Time", "NFS");
  Preference    = "None";
  Messages =
  {
    start = "Starting Postgres";
    stop  = "Stopping Postgres";
    restart  = "Reloading Postgres Configuration";
  };
}


AOL start

StartService ()
{
    if [ "${AOLServer:=-NO-}" = "-YES-" ]; then
            ConsoleMessage "Starting AOLServer"
            /usr/local/aolserver/bin/run.sh
    fi
}


AOLServer Plist
{
  Description   = "AOLServer";
  Provides      = ("AOL");
  Requires      = ("PSQL");
  Uses          = ("Network Time", "NFS");
  Preference    = "None";
  Messages =
  {
    start = "Starting AOLServer";
    stop  = "Stopping AOLServer";
    restart  = "Reloading AOLServer Configuration";
  };
}