Forum OpenACS Q&A: Re: My production site is down

Collapse
Posted by Tom Jackson on

Roberto Mello wrote:

There's also djb's supervise, but as with every other djb tool, it's non-free, hard to setup and non-intuitive to understand.

I'm sorry that I can't resist. Just download and install djb's daemontools package. It is a one or two minute install process. Then to start AOLserver you create a file called run in some directory. I use /web/control/servername. The run script should set any environment variables you need and then start AOLserver. Here is a copy of mine, which works for both pg and Oracle:

#!/bin/bash

export ORACLE_HOME="/ora8/m01/app/oracle/product/8.1.7"
export ORACLE_BASE="/ora8/m01/app/oracle"
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib:/usr/local/pgsql/lib:$LD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/ctx/lib:$PATH
export ORACLE_SID='ora8'
export ORACLE_TERM='vt100'
export ORAENV_ASK=NO
export NLS_DATE_FORMAT="YYYY-MM-DD"
export LD_ASSUME_KERNEL=2.2.5
sleep 4

exec /usr/local/aolserver/bin/nsd -it \ 
 /web/control/iunicycle-oracle/iunicycle-oracle-nsd.tcl -u \
 iunicycle -g web 

Then you just link the directory to the /service directory:

ln -s /web/control/servername /service

Your webserver should start in a few seconds.

If your server seems to not startup, or constantly restarts without printing to the error.log why it is dying (usually a startup file syntax error), you can use ps axww|grep readproctitle to show the last 400 chars of output.

Start and stop, restart of your server:

svc -u /service/servername
svc -d /service/servername
svc -k /service/servername
svc -o /service/servername ;# start once, don't restart

Getting a status on how long the server is up/down:

svstat /service/servername

My opinion is software is never intuitive, but it can have simple commands and good documentation.

Collapse
Posted by Roberto Mello on
I've installed AOLserver and OpenACS many many times before, so I'm quite good at it by now. Does that mean it's easy to install? Not really?

Does that make daemontools less non-free? No.

djb tools, while of high quality software-wise (or so I heard, I only briefly read the code for qmail and he still uses K&R syntax) like to install its things in non-standard locations, hence the "hard to setup and use" part of my post.

As long as there are free secure alternatives, who try to obey to standards, I'll stick to them.

-Roberto