# HG changeset patch # User Matthew Wild # Date 1348054761 -3600 # Node ID 43c5227fdd3ba7c8a4f0cce6bb47c88e08f0bb42 # Parent 1443d1c37c6c7ad5657bd06359406932af2be042 prosody, prosodyctl: chdir() to data directory on startup diff -r 1443d1c37c6c -r 43c5227fdd3b prosody --- a/prosody Wed Sep 19 12:14:08 2012 +0100 +++ b/prosody Wed Sep 19 12:39:21 2012 +0100 @@ -228,6 +228,11 @@ 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 -r 1443d1c37c6c -r 43c5227fdd3b prosodyctl --- a/prosodyctl Wed Sep 19 12:14:08 2012 +0100 +++ b/prosodyctl Wed Sep 19 12:39:21 2012 +0100 @@ -50,6 +50,7 @@ platform = "posix"; lock_globals = function () end; unlock_globals = function () end; + installed = CFG_SOURCEDIR ~= nil; }; _G.prosody = prosody; @@ -119,6 +120,11 @@ 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();