[daisy] [JIRA] Created: (DSY-431) Daisy wiki wrapper script
should check/wait 'smart' for the repository to run!
Bruno Dumon
bruno at outerthought.org
Tue Mar 27 03:46:52 CDT 2007
On Tue, 2007-03-20 at 14:48 +0100, Andreas Deininger wrote:
> 2007/3/20, Bruno Dumon <bruno at outerthought.org>:
> > On Tue, 2007-03-20 at 08:32 +0100, Andreas Deininger wrote:
> > > 2007/3/19, Steven Noels <stevenn at outerthought.org>:
> > > > On 19 Mar 2007, at 23:01, Marc Portier (JIRA) wrote:
> > > >
> > > > > wait_for_server_start () {
> > > > > port=$1
> > > > > counter=0
> > > > > serverstatus=`netstat -l | grep -e "^tcp.*:${port}"`
> > > >
> > > > That command is pretty Linux-specific, I'm afraid.
> > >
> > > Windows has yet another version (coming with the MSYS Tools):
> > >
> > > NETSTAT [-a] [-b] [-e] [-n] [-o] [-p Protokoll] [-r] [-s] [-v] [Intervall]
> > >
> > > Inside my windows installer, I'm facing exactly the same problem.
> > > Here, I'm using a utility called T4ePingPort which is used to check
> > > whether we can successfully to the daisy repository and wiki. It is
> > > taken from the Tools4ever Command Line Utilities Bundle, which can be
> > > obtained via:
> > > http://www.tools4ever.com/products/free/command/.
> > >
> >
> > Maybe something can be written in Java, so that it would work on any
> > platform.
> >
> > > I'm wondering whether we shouldn't go the other way and tackling that
> > > issue from the wiki side (besides altering the startup scripts, which
> > > could be also useful). There was an issue on that (DSY 317) already
> > > which was discarded.
> > > Would be nice if instead on cocoon error page talking about an
> > > initialization error there would be a button "Reconnect" that allows
> > > you to try to connect to the repository again. Now idea how difficult
> > > it would be to implement such a behaviour.
> >
> > A "Reconnect" button seems pretty strange to me. Could you imagine
> > surfing to e.g. google.com and seeing such a button there? :-)
> >
> > A possible solution would be to do the initialization in a background
> > thread, which could retry to connect until it succeeds. This way,
> > initialization of cocoon will not fail, a nicer error can be shown if
> > the connnection was not yet established, and it copes with the wiki
> > being up earlier than the repo.
>
> Maybe we could come up with a reusable solution that could be used
> during the daisy wiki and wiki data initialisation, too, since we are
> facing almost the same problem there. This way, maybe a port check
> utility will not be needed at all.
>
I've given this some more thought and came to the conclusion that the
solution I was thinking of wasn't so simple after all. It's not only the
initialization of the RemoteRepositoryManager which needs to be delayed,
but also of all components depending on it (in the Wiki e.g. the user
registrar) and of the JMS component.
So it would rather have to be the initialization of Cocoon as a whole
which needs to be delayed. Or components depending on the
RemoteRepositoryManager should be designed to initialize only upon first
request. Not sure if this is a good idea though.
For now, it seems delaying the startup of the servlet container until
the repository server is running is the best solution.
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno at outerthought.org bruno at apache.org
More information about the daisy
mailing list