I just upgraded several sites from AOLserver 4.0.8 to 4.0.10.  I added
the following script to /usr/local/aolserver/modules/tcl/roll-logs.tcl,
as I always do:

# from Michael Cleverly:
#
http://www.opennsd.org/bboard/q-and-a-fetch-msg.tcl?
msg_id=00005n&topic_id=1&t
opic=OpenNSD

proc roll_logs {} {
  set server_name [ns_info server]
  set yesterday [ns_fmttime [expr [ns_time] - 86400] %Y-%m-%d]
  set access_file_name [ns_config ns/server/${server_name}/module/nslog
File]

  # access log
  ns_accesslog roll $access_file_name.$yesterday
  # server log
  ns_logroll
}

ns_share -init {set schedule_roll 0} schedule_roll
if {!$schedule_roll} {
  ns_schedule_daily 0 0 roll_logs
  ns_log Notice "roll_logs for [ns_info server] has been scheduled at
12:00 am."
}

Up to now, the ns_share has kept the proc from being scheduled more
than once.  Now, however, with 4.0.10 it seems to be happening in each
thread.  So with maxthreads set to 5, the script gets scheduled five
times.

I know that this is old code and that ns_share was deprecated a long
time ago.  Can someone clue me in on what the modern way to schedule
this only once would be?

thanks,

janine


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to