From dd0f8b36d50bd0840ca6f5cbd34269ee188a702d Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Thu, 19 Nov 2009 15:17:04 +0000 Subject: [PATCH] Moved ejabberd initialization check loop inside the if statement, since we only have to check for it in the first startup svn path=/nixos/branches/upstart-0.6/; revision=18464 --- modules/services/networking/ejabberd.nix | 32 ++++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/modules/services/networking/ejabberd.nix b/modules/services/networking/ejabberd.nix index 82a51267a80..6643d4f9c52 100644 --- a/modules/services/networking/ejabberd.nix +++ b/modules/services/networking/ejabberd.nix @@ -87,24 +87,24 @@ in ejabberdctl --config-dir ${cfg.confDir} --logs ${cfg.logsDir} --spool ${cfg.spoolDir} start ${if cfg.loadDumps == [] then "" else - '' - # Wait until the ejabberd server is available for use - count=0 - while ! ejabberdctl --config-dir ${cfg.confDir} --logs ${cfg.logsDir} --spool ${cfg.spoolDir} status - do - if [ $count -eq 30 ] - then - echo "Tried 30 times, giving up..." - exit 1 - fi - - echo "Ejabberd daemon not yet started. Waiting for 1 second..." - count=$((count++)) - sleep 1 - done - + '' if [ "$initialize" = "1" ] then + # Wait until the ejabberd server is available for use + count=0 + while ! ejabberdctl --config-dir ${cfg.confDir} --logs ${cfg.logsDir} --spool ${cfg.spoolDir} status + do + if [ $count -eq 30 ] + then + echo "Tried 30 times, giving up..." + exit 1 + fi + + echo "Ejabberd daemon not yet started. Waiting for 1 second..." + count=$((count++)) + sleep 1 + done + ${concatMapStrings (dump: '' echo "Importing dump: ${dump}"