Forum OpenACS Q&A: Re: AOLserver 4 and daemontools

Collapse
Posted by Mark Aufflick on
More datapoints,

I have aolserver 4 running on both port 80 and 443 (ssl) using the -B flag and it starts and runs fine. Why you can't just use multiple -b options, though, makes no sense to me.

I don't use multilog, and I use the standard run script (plus the -B option).

The only problem I have is with restarting. cvs -t restarts fine, except the server complains it can't open ports 80 or 443. If I restart again it comes good. Or if I svc -d, wait for the log to show a complete shutdown then svc -u everything works correctly.

I haven't tried putting a delay into the run script itslef, but i don't think that would work. I think what I need is to write a script that does an svc -d, waits to see sutdown complete in the log, then does a svc -u.

If it did a -k should the server fail to stop in a reasonable time, all the better.

Of course we could jsut fix the nsd bug...

Collapse
Posted by Bart Teeuwisse on
Mark,

what version of AOLserver do you run? A previous version did have problems releasing the ports when restarting. There is no need to add a delay in the run script. At least not when you restart with 'svc -du'.

/Bart

Collapse
Posted by Mark Aufflick on
My CVS/Tag file tells me I compiled aolserver_v40_r2.

Is svc -du different to svc -t ?

Collapse
Posted by Randy O'Meara on
Mark,

My svc(8) page says:

       -u     Up. If the service is not running,  start  it.  If  the  service
              stops, restart it.
                                                                                
       -d     Down.  If the service is running, send it a TERM signal and then
              a CONT signal. After it stops, do not restart it.
                                                                                
       -t     Terminate. Send the service a TERM signal.
So, it looks like -du sends TERM then CONT while -t just sends TERM. It doesn't really say if -d and -u are handled serially or in the order of appearance. I've never used it this way.

Bart, do you know?

/R

Collapse
Posted by Bart Teeuwisse on
Randy,

svc executes the flags in the order of appearance. Thus 'svc -hdu' rolls the AOLserver log (when not using multilog), stops the server and restarts it again. The rolled log starts with the message that the server is shutting down followed by the restart.

Where as 'svc -dhu' will stutdown the server, send a SIGHUP which will be missed as the server is down and restart the server. In this case the server restarts but the log won't be rolled.

For the sake of completeness, when using multilog, AOLserver runs in foreground mode and won't write to a log itself. Instead the messages to STDOUT are piped to mutilog who writes it to a different log. Rolling a multilog is done w/ 'svc -a'.

I've ran AOLserver in both configurations. I favor multilog as it garantues that the logs won't exceed a set maximum amount of disk space. With a wrapper script in /etc/init.d both configurations can be controled with 'service <service0> {start|stop|restart|roll|stat}'.

/Bart