prosody, prosodyctl: chdir() to data directory on startup
[prosody.git] / prosody
diff --git a/prosody b/prosody
index b8de92f59c4f235d0dc8e64b8d3c45b345a9cada..c1606874a4a6f77da359e1dce9f6e88458161119 100755 (executable)
--- a/prosody
+++ b/prosody
@@ -228,6 +228,11 @@ function init_global_state()
                prosody.installed = true;
        end
        
+       if prosody.installed then
+               -- Change working directory to data path.
+               require "lfs".chdir(data_path);
+       end
+
        -- Function to reload the config file
        function prosody.reload_config()
                log("info", "Reloading configuration file");