From 0cf860fc7a3f78c4a6171b93107e1e225e6bded7 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 19 Sep 2012 12:39:21 +0100 Subject: prosody, prosodyctl: chdir() to data directory on startup --- prosodyctl | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'prosodyctl') 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(); -- cgit v1.2.3