[daisy] tanuki wrapper dependencies
Paul Focke
paul at outerthought.org
Thu Sep 7 03:25:05 CDT 2006
Steven Noels wrote:
> On 07 Sep 2006, at 09:38, Victor Oomens wrote:
>> But now, after rebooting the machine (which has been scheduled to run
>> every week),
> why that? any Daisy-related reason? we run Daisy on boxes which have
> been up for more than a year.
>> the repository fails to connect to OpenJMS. It seems that openjms
>> isn’t running when the repo tries to connect.
> could you provide us with some factual error output? I don't have much
> Redhat experience, but knowing things for sure might help. Have you
> tweaked the order in which services are started? How? Adding a sleep
> statement in the shell scripts might help as well.
>> To solve that, I’ve added some lines to the dsy_repo startup script.
>> The script now first waits for the openjms to become available before
>> starting the repository. However, this doesn’t seem to be full proof.
>>
>>
>>
>> Is there another solution? For example, can I configure the tanuki
>> wrapper to detect the OpenJMS dependency?
> that's obviously a tanuki question. Paul has been working on a Debian
> package and I know he encountered some of that stuff as well. Maybe he
> has some tips or ideas.
Basically what I do is add a check to wait (sleeps) until the service
has started before moving on. Here is code example of this check
wait_for_server_start () {
port=$1
counter=0
serverstatus=`netstat -l | grep -e "^tcp.*:${port}"`
while [[ -z "${serverstatus}" && ${counter} -lt 12 ]]; do
sleep 2s
serverstatus=`netstat -l | grep -e "^tcp.*:${port}"`
let counter=counter+1
done
if [ -z "${serverstatus}" ]; then
echo Not listening to port $port . Exiting ...
exit 1
else
echo Listening to port $port
fi
}
Then in the start() function of the service method at the end of the
true branch in if structure I add
wait_for_server_start $LISTEN_PORT
where LISTEN_PORT is the port the server listens to. In OpenJMS this
would be 3030, if I remember correctly.
Now if the script fails then you should have a look at your OpenJMS
setup. The logging is also a good place to have a look at if services
don't seem to start.
Paul
>
> </Steven>
> --Steven Noels http://outerthought.org/
> Outerthought Open Source Java & XML
> stevenn at outerthought.org stevenn at apache.org
>
>
> _______________________________________________
> daisy community mailing list
> Professional Daisy support:
> http://outerthought.org/site/services/daisy/daisysupport.html
> mail to: daisy at lists.cocoondev.org
> list information: http://lists.cocoondev.org/mailman/listinfo/daisy
More information about the daisy
mailing list