Software / code / prosody
Comparison
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 |
comparison
equal
deleted
inserted
replaced
| 5133:1443d1c37c6c | 5134:43c5227fdd3b |
|---|---|
| 48 hosts = {}; | 48 hosts = {}; |
| 49 events = require "util.events".new(); | 49 events = require "util.events".new(); |
| 50 platform = "posix"; | 50 platform = "posix"; |
| 51 lock_globals = function () end; | 51 lock_globals = function () end; |
| 52 unlock_globals = function () end; | 52 unlock_globals = function () end; |
| 53 installed = CFG_SOURCEDIR ~= nil; | |
| 53 }; | 54 }; |
| 54 _G.prosody = prosody; | 55 _G.prosody = prosody; |
| 55 | 56 |
| 56 local dependencies = require "util.dependencies"; | 57 local dependencies = require "util.dependencies"; |
| 57 if not dependencies.check_dependencies() then | 58 if not dependencies.check_dependencies() then |
| 116 -- path1;path2;path3;defaultpath... | 117 -- path1;path2;path3;defaultpath... |
| 117 CFG_PLUGINDIR = table.concat(custom_plugin_paths, path_sep)..path_sep..(CFG_PLUGINDIR or "plugins"); | 118 CFG_PLUGINDIR = table.concat(custom_plugin_paths, path_sep)..path_sep..(CFG_PLUGINDIR or "plugins"); |
| 118 end | 119 end |
| 119 prosody.paths = { source = CFG_SOURCEDIR, config = CFG_CONFIGDIR, | 120 prosody.paths = { source = CFG_SOURCEDIR, config = CFG_CONFIGDIR, |
| 120 plugins = CFG_PLUGINDIR or "plugins", data = data_path }; | 121 plugins = CFG_PLUGINDIR or "plugins", data = data_path }; |
| 122 | |
| 123 if prosody.installed then | |
| 124 -- Change working directory to data path. | |
| 125 require "lfs".chdir(data_path); | |
| 126 end | |
| 121 | 127 |
| 122 require "core.loggingmanager" | 128 require "core.loggingmanager" |
| 123 | 129 |
| 124 dependencies.log_warnings(); | 130 dependencies.log_warnings(); |
| 125 | 131 |