Forum OpenACS Q&A: Daemontools question

Collapse
Posted by C. R. Oldham on
Greetings,

I am moving to Daemontools to keep my AOLserver instances up.  When AOLserver is started by inittab, inittab can notice if the service is flapping or restarting too many times in a short period, and it then throttles to avoid filling up logfiles and such.  Does daemontools do that?

Collapse
2: Re: Daemontools question (response to 1)
Posted by Tom Jackson on

No, daemontools supervise will continue to try to restart the server. However, you might put in your run file a sleep:

#!/bin/bash

sleep 4

...

Daemontools also has a feature I have found missing with inittab. What to do when a config file has a syntax error, or any error is thrown while reading the config file. Use readproctitle:


# ps axww|grep readproctitle

This will display the errors which are being generated but don't yet have a place to go, so never show up.

Also use the script 'svgroup' to allow your development group control the service. This script is now a part of OpenACS, but I'll repeat it here:

[tom@mimer tcl]$ cat /usr/sbin/svgroup
#! /bin/sh
if test $# -lt 2 ; then
    echo svgroup groupname directories ... >&2
    echo for example: >&2
    echo svgroup wheel /service/\* >&2
    exit 2
fi
g="$1" ; shift
for i in $* ; do
    chgrp $g $i/supervise/control
    chmod g+w $i/supervise/control
    chgrp $g $i/supervise/ok
    chmod g+w $i/supervise/ok
    # just in case
    chgrp $g $i/supervise/status
    chmod g+r $i/supervise/status
    chgrp $g $i/supervise
    chmod g+x $i/supervise
done


Then as root run 'svgroup web-group /service/serviceX'

Collapse
3: Re: Daemontools question (response to 1)
Posted by C. R. Oldham on
Tom,

I had never seen that script before--thanks so much!

Collapse
4: Re: Daemontools question (response to 1)
Posted by Harish Krishnan on
The daemon tools seem buggy to me on aolserver4. I need to follow a series of commands like:
svc -d /service/server
svc -k /service/server
svc -t /service/server
svc -u /service/server.
If I donnot do that the error log says that the port was not captured permission denied. This happens in the case I have to restart but when keep alive restarts the server it seems to function ok.

Is there a fix available or am is there something wrong with my set up?

Thanks in advance,

regards
Harish

Collapse
5: Re: Daemontools question (response to 4)
Posted by Tom Jackson on

Make sure you update to the latest version of AOLserver: 4.0.1. To restart an older version you might need -k (which I use anyway), but the latest version may restart with a -t. Now the non-capture issue is that AOLserver is restarting a little too fast. In your 'run' script put in a sleep, i.e.:

sleep 4

exec nsd ...

Neither of these issues has to do with Daemontools, although we need to keep looking for reasons not to use this daemonic tool.