Forum OpenACS Q&A: AOLserver unexpectedly restarting

Collapse
Posted by Ayman M on
Hi,

Im not sure how to explain this but every 10 minutes, my aolserver 
restarts and i dont know why. The lines immediately before it 
restarting are as follows:

____________________________________________________________________

[03/Oct/2002:02:02:18][3998.2051][-sched-] Debug: QD_LOGGER = POST-
QD: the SQL is 
	select object_id, date, event
	from search_observer_queue
	order by date asc
    
[03/Oct/2002:02:02:18][3998.2051][-sched-] Debug: PgBindCmd: sql = 
	select object_id, date, event
	from search_observer_queue
	order by date asc
    
[03/Oct/2002:02:02:18][3998.2051][-sched-] Notice: Querying '
	select object_id, date, event
	from search_observer_queue
	order by date asc;'
[03/Oct/2002:02:02:18][3998.2051][-sched-] Notice: dbinit: sql
(localhost::thesis): '
	select object_id, date, event
	from search_observer_queue
	order by date asc
    '
[03/Oct/2002:02:02:18][3998.2051][-sched-] Notice: Done running 
scheduled proc search_indexer.
[03/Oct/2002:02:02:34][4094.1024][-main-] Notice: nsmain: 
AOLserver/3.3.1+ad13 starting

____________________________________________________________________

Ive however been told that the search_indexer runs every 30/60 
seconds so im not sure if its that. Any ideas on what it could be or 
how i can check what is causing this?

After i load linux and the aolserver is running, it doesnt restart at 
all, it just sits there which is good. But once I connect to 
localhost and run some of my package that I am developing, this 
happens. The thing that has me completely confused is that it happens 
exactly every 10mins so im thinking it must be something scheduled or 
timeouts and not just my code crashing. When i dont run any of my 
code in the 10min period, it doesnt restart.

I hope that made sense. Any help would be appreciated.
Ayman
Collapse
Posted by David Walker on
/etc/cron.d/ runs every 10 minutes

Anything interesting in there?
What distribution and version of Linux are you running?
Collapse
Posted by Ayman M on
Im running Mandrake Linux 8.2. There is nothing in the cron.d directory.

I left my machine for the last 40 mins or so and it hasnt restarted. I then ran a page from my package just then and on the 10min interval for when the other times were restarting, it restarted again.

The page i ran was a login page which called a function from an ns_mail IMAP module. It calls the open function from this.

This may be a long shot but could it have anything to do with OpenSSL or nsopenssl as i installed these and compiled the ns_mail module with ssl. (just a wild suggestion)

I hope that explains more about my situtation and can help somehow.
Ayman

Collapse
Posted by Jeff Davis on
Ayman,  It has all the symptoms of being a bug somewhere in the C code
rather than in anything you have done.  You could try running
aolserver from gdb and see if you get a stack trace.  You could also run strace and look what happens at the end.
Collapse
Posted by Ayman M on
Im not sure exactly how i could do that or what commands to run to perform gdb or strace.
Would you be so kind to explain how I could run these.

Thanks
Collapse
Posted by Jeff Davis on
Set and env variable you need (and you might want to
change the server to listen on a high port so you can
do this w/o being root)...
<pre>
strace -f -o t.log nsd8x -f -t server.tcl
</pre>
When it dies look at the end of t.log
<p>
With gdb
<pre>
gdb nsd8x
(gdb) run -f -t server.tcl
</pre>
when the process dies you should be able to tell if it was an
exit or get a stack trace if not (with the "where" command).
You might have to "set follow-fork-mode child" before the run but I
can't remember off the top of my head.
Collapse
Posted by David Walker on
AOLServer crashed for me inside the ns_log function (at vsnprintf if
I recall right) under Mandrake when libsafe was installed. Remove
libsafe and it ran fine.  This might point to a buffer overflow or
something in the ns_log function but I am not capable of determining
that.
Collapse
Posted by Vlad Seryakov on
I had a bug in earlier versions of nsmail regarding grabage collecting, by default it runs evey 10 mins, so it might be it. Try to disable it by setting

ns_section ns/server/${servername}/module/nsmail
ns_param gc_interval 0

or you can download most recent nsimap 2.4 module which is renamed nsmail 2.4 with this bug fixed.