Forum OpenACS Q&A: Re: Monitoring Package: How do I get the top stats to work?

Had another mail in my inbox with the same error message rather than useful stats and it motivated me to look at the problem again.

If I start up a tclsh and type "exec top -bn1" it does what I want it to do. If I run the same command from within the OpenACS Shell I get the same error: "top could not be run - TERM environment variable not set".

Using the the OpenACS shell I set TERM to vt100 and all of a sudden I am able to run top with the batch flag so the package can do its magic: guess the package was written for more prehistoric forms of top (I assume newer versions of top require the TERM variable to do some fancy interactive formatting).

So now my question is:

Where/how do I set the environment variables of the nsd process on startup so this continues to work after a restart AOLServer?

Where/how do I set the environment variables of the nsd process on startup so this continues to work after a restart AOLServer?

You should be able to set env vars in the nsd-postgres wrapper script that starts up aolserver.

Another place is in the openacs-4/etc/daemontools/run script. The default install of OpenACS does not use nsd-postgre/oracle.
Thanks. Tekbase helped on #aolserver too. I want to get monitoring working correctly by default. Does it make sense to add TERM=vt100 (or something else) to the run script? Seems kind of strange to add it there, but I could not find any flags in the top man pages that force it to run without asking for $TERM. What is the best thing to do in this case. Go ahead and add the variable? Add it as a comment (and add some documentation to the package)? Let me know and I will do it.