Forum OpenACS Q&A: Re: AOLserver 4 and daemontools

Collapse
Posted by Randy O'Meara on
Mark,

Deamontools must run aolserver in foreground mode (-f) not inittab mode (-i). Here's my run file.

#!/bin/sh

IP=192.168.1.250
port=8001
server=s${port}
serverroot=/devel/${server}

export AOLSERVER_HOME=/opt/aolserver4
exec 2>&1
exec $AOLSERVER_HOME/bin/nsd -fzt \
	${serverroot}/aolconf.tcl \
	-u ${server} -g ${server} \
	-b ${IP}:${port}
Collapse
Posted by Bart Teeuwisse on
For the record, nsd does NOT have to run in foreground mode when using daemontools. ONLY when using multilog DOES nsd have to run in foreground mode so that Daemontools can pipe the output of the supervised process (nsd) to multilog.

The standard logging will go to never-never land if you start nsd in foreground mode using daemontools but don't use multilog.

As for the problem at hand, I would suggest switching to foreground mode and then start the run script from the command line: /service/front-end/run.

This will print all log messages to STDOUT and gives you a change to examine the log.

I can also advise the use of multilog in combination w/ daemontools. Your error logs will roll when they get too large and you get specify how many old log files you like to keep around. See https://openacs.org/forums/message-view?message_id=120023 for instructions how to use multilog w/ AOLserver.

I'm not sure what the problem is here. I'm running AOLserver 4.x just fine under daemontools. It might be a permission issue.

/Bart

Collapse
Posted by Randy O'Meara on
Bart's suggestion is a good one. What do you see when running it with a command equivalent to the run file I provided?

I've seen odd logging behavior due to permissions.

You could try this: (modify commands to match your OS utilities)

$ su - root
# cd /web/front-end
# svc -d .
# svstat .  (make sure it's down)
# chown -R nsadmin.web supervise log   (assuming "log" is correct logging dir)
# su - nsadmin
$ cd /web/front-end
$ svc -u .
$ svstat .  (make sure it's up)
$ ps -axw | grep readproc
/R