Forum OpenACS Q&A: AOLServer is logging erratically

Collapse
Posted by Reuven Lerner on
I'm developing a site using OpenACS 4.5 on a system hosted by hub.org,
running FreeBSD 4.6-STABLE.  Everything has been going great during
the development process, and the hub.org people have been really
helpful in ensuring that the system runs smoothly.  AOLServer is
running under daemontools, which I'm increasingly convinced is a
fabulous tool.

But in the last few days, our AOLServer error logs have gotten totally
messed up: ns_log no longer sends anything to the error log, and while
we get error messages when things go wrong, such messages are often
truncated.  And they're nowhere nearly as verbose as they used to be.

Has anyone ever experienced anything like this?  Is there anything
obvious that I should be looking at, other than nsd.tcl (which seems
fine)?

I should note that we are getting *something* in the error log, so it
doen't seem like permissions are at fault.  We've stopped and
restarted the server a fair number of times, erasing the error log
while the system is down -- to no avail.

Any ideas?

Collapse
Posted by Randy O'Meara on

Reuven, I would look closely at my daemontools logging configuration. If it's setup correctly with multilog, you should see error log content being appended to "current" and it should roll according to the multilog options (see the error "run" file below).

I've included a portion of my own setup instuctions that you might use as a guide.

Hope this helps.

Config daemontools (as nsadmin)
$ cd ~nsadmin/servers/openacs4
$ cat run
    #!/bin/sh
    export AOLSERVER_HOME=/u1/aolserver
    exec 2>&1
    exec $AOLSERVER_HOME/bin/nsd -fzt /etc/aolserver/conf/openacs4.tcl -u nsadmin -g nsadmin
$ chmod +x run
$ cd log
$ cat run
    #!/bin/sh
    exec setuidgid nsadmin multilog s999999 ./error
$ chmod +x run

Place under daemontools control (as root)
# cd /service
# ln -s ~nsadmin/servers/openacs4 openacs4
# ps ax | grep openacs4  (until "supervise openacs4" appears)
# cd ~nsadmin/servers/openacs4
# chown -R nsadmin.nsadmin supervise log/supervise
# chmod -R g+rwx supervise log/supervise

REBOOT and check error logs