aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xprosody5
-rwxr-xr-xprosodyctl6
2 files changed, 11 insertions, 0 deletions
diff --git a/prosody b/prosody
index b8de92f5..c1606874 100755
--- 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");
diff --git a/prosodyctl b/prosodyctl
index 25570fc4..d4aa6d5e 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -50,6 +50,7 @@ local prosody = {
platform = "posix";
lock_globals = function () end;
unlock_globals = function () end;
+ installed = CFG_SOURCEDIR ~= nil;
};
_G.prosody = prosody;
@@ -119,6 +120,11 @@ end
prosody.paths = { source = CFG_SOURCEDIR, config = CFG_CONFIGDIR,
plugins = CFG_PLUGINDIR or "plugins", data = data_path };
+if prosody.installed then
+ -- Change working directory to data path.
+ require "lfs".chdir(data_path);
+end
+
require "core.loggingmanager"
dependencies.log_warnings();