Forum OpenACS Q&A: Response to Rolling logs

Collapse
4: Response to Rolling logs (response to 1)
Posted by Andrei Popov on

Don, Jonathan, thanks.

I think I finally figured how to do it. FWIW, here's what I do (caveat: this is on FreeBSD, applicability to other systems may vary):

  1. In nsd.tcl relevent section looks as follows:

    ns_section ns/parameters
            ns_param serverlog      /var/log/aolserver/${server}.log
            ns_param pidfile        ${homedir}/log/nspid.${server}
            ns_param home           ${homedir}
            ns_param maxkeepalive   0
            ns_param maxbackup      5
            ns_param debug          ${debug}
            ns_param logroll        true
    

  2. I then add the following line to /etc/newsyslog.conf:
    #logfilename [owner:group] mode count size when [ZJB] [/pid_file] [sig_num]
    /var/log/aolserver/openacs-dev.log nsadmin:www 640 5 100 * B 
    /usr/local/aolserver/log/nspid.openacs-dev 1
    

Now, AOLServer stores PID in nspid.$server file that is accessible by syslog, that is used to send signal 1 (SIGHUP) to the process with that ID.