[daisy] [JIRA] Commented: (DSY-431) Daisy wiki wrapper script should check/wait 'smart' for the repository to run!

Marc Portier (JIRA) issues at cocoondev.org
Tue Mar 27 04:38:20 CDT 2007


    [ http://issues.cocoondev.org//browse/DSY-431?page=comments#action_13094 ] 

Marc Portier commented on DSY-431:
----------------------------------

If I read Bruno's conclusion correctly then the upcoming 2.0 release would just take Scott's suggestion and code the extra wait into the wrapper scripts?

Only extra amendment I would like to make in that case is somewhat allow the wiki to also get started 'directly' when the administrator is sure the repository is already running.

Basically I'm thinking about having a 2nd argument to the shell script:
$ sudo /etc/init.d/dsy-wiki start now

or a second service script
$ sudo /etc/init/dsy-wiki-now start

to be able to avoid the waiting... 
(possibly by passing an enviroment variable to the configuration?
   wrapper.startup.delay=%DAISY_WIKI_WAIT% ?)

remaining questions:
* useful or over the top?
* technically feasible as suggested?
* useful as is or equivalents for windows platform available?
  e.g. set DAISY_WIKI_WAIT=0; net start dsy-wiki 
  (or whatever the correct syntax would be)

> Daisy wiki wrapper script should check/wait 'smart' for the repository to run!
> ------------------------------------------------------------------------------
>
>          Key: DSY-431
>          URL: http://issues.cocoondev.org//browse/DSY-431
>      Project: Daisy
>         Type: Improvement
>     Reporter: Marc Portier
>     Priority: Minor

>
> Now that we have the wrapper scripts packaged in the distro I can assume people are going to be hooking them up easily as init.d start-stop scripts on their linux distro (or as services on windows)
> However, on linux I've seen this cause the wiki to start up before the repo is actually running and thus make the wiki initialize badly (typical symptom is a cocoon error page talking about an initialization error)
> In our experimental debian package we already have scripts with a trick for this (see below)
> Before hacking this in as a patch for the shell scripts, I'ld like to learn if Windows services have similar issues, and if we could find a common solution?
> 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
> }
> + call this wait...() function from the start() 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.cocoondev.org//secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



More information about the daisy mailing list