prosody: Check dependencies later in the startup sequence
authorKim Alvefur <zash@zash.se>
Wed, 9 Apr 2014 18:46:39 +0000 (20:46 +0200)
committerKim Alvefur <zash@zash.se>
Wed, 9 Apr 2014 18:46:39 +0000 (20:46 +0200)
prosody

diff --git a/prosody b/prosody
index ee2baca500062bb3b5bf293ce1b65810b9d9cbbe..446dbfb7344fb15263a1d9cc9d69e7d052be0051 100755 (executable)
--- a/prosody
+++ b/prosody
@@ -49,9 +49,6 @@ _G.prosody = prosody;
 
 -- Check dependencies
 local dependencies = require "util.dependencies";
-if not dependencies.check_dependencies() then
-       os.exit(1);
-end
 
 -- Load the config-parsing module
 config = require "core.configmanager"
@@ -116,6 +113,12 @@ function read_config()
        end
 end
 
+function check_dependencies()
+       if not dependencies.check_dependencies() then
+               os.exit(1);
+       end
+end
+
 function load_libraries()
        -- Load socket framework
        server = require "net.server"
@@ -388,6 +391,7 @@ init_logging();
 sanity_check();
 sandbox_require();
 set_function_metatable();
+check_dependencies();
 load_libraries();
 init_global_state();
 read_version();