projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
66861ab
)
prosody, prosodyctl: chdir() to data directory on startup
author
Matthew Wild
<mwild1@gmail.com>
Wed, 19 Sep 2012 11:39:21 +0000
(12:39 +0100)
committer
Matthew Wild
<mwild1@gmail.com>
Wed, 19 Sep 2012 11:39:21 +0000
(12:39 +0100)
prosody
patch
|
blob
|
history
prosodyctl
patch
|
blob
|
history
diff --git
a/prosody
b/prosody
index b8de92f59c4f235d0dc8e64b8d3c45b345a9cada..c1606874a4a6f77da359e1dce9f6e88458161119 100755
(executable)
--- a/
prosody
+++ b/
prosody
@@
-228,6
+228,11
@@
function init_global_state()
prosody.installed = true;
end
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");
-- Function to reload the config file
function prosody.reload_config()
log("info", "Reloading configuration file");
diff --git
a/prosodyctl
b/prosodyctl
index 25570fc44f3521599b8b56b636d9808fc48c26bb..d4aa6d5ef57e05aea1fc349c4aa551514b3ac650 100755
(executable)
--- a/
prosodyctl
+++ b/
prosodyctl
@@
-50,6
+50,7
@@
local prosody = {
platform = "posix";
lock_globals = function () end;
unlock_globals = function () end;
platform = "posix";
lock_globals = function () end;
unlock_globals = function () end;
+ installed = CFG_SOURCEDIR ~= nil;
};
_G.prosody = prosody;
};
_G.prosody = prosody;
@@
-119,6
+120,11
@@
end
prosody.paths = { source = CFG_SOURCEDIR, config = CFG_CONFIGDIR,
plugins = CFG_PLUGINDIR or "plugins", data = data_path };
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();
require "core.loggingmanager"
dependencies.log_warnings();