diff options
author | Matthew Wild <mwild1@gmail.com> | 2012-09-19 12:39:21 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2012-09-19 12:39:21 +0100 |
commit | 0cf860fc7a3f78c4a6171b93107e1e225e6bded7 (patch) | |
tree | 3abf83e55e8be8ee509ec6738437e8fdbb937e8b | |
parent | a868b41b589356e9231df919a1771cc99b20d54b (diff) | |
download | prosody-0cf860fc7a3f78c4a6171b93107e1e225e6bded7.tar.gz prosody-0cf860fc7a3f78c4a6171b93107e1e225e6bded7.zip |
prosody, prosodyctl: chdir() to data directory on startup
-rwxr-xr-x | prosody | 5 | ||||
-rwxr-xr-x | prosodyctl | 6 |
2 files changed, 11 insertions, 0 deletions
@@ -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"); @@ -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(); |