Diff

prosodyctl @ 5134:43c5227fdd3b

prosody, prosodyctl: chdir() to data directory on startup
author Matthew Wild <mwild1@gmail.com>
date Wed, 19 Sep 2012 12:39:21 +0100
parent 5101:a94c43cad081
child 5138:7dc57dfaebbe
child 5142:3221746f4769
line wrap: on
line diff
--- 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();