Software / code / prosody
Comparison
prosodyctl @ 2442:94c676b585c0
prosodyctl: Move definition of prosody singleton to prior to loading datamanager, and add platform
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sun, 10 Jan 2010 23:11:28 +0000 |
| parent | 2439:511ba389147a |
| child | 2455:0b3184f3c9e4 |
comparison
equal
deleted
inserted
replaced
| 2441:d72078946a16 | 2442:94c676b585c0 |
|---|---|
| 58 print(""); | 58 print(""); |
| 59 os.exit(1); | 59 os.exit(1); |
| 60 end | 60 end |
| 61 end | 61 end |
| 62 | 62 |
| 63 prosody = { hosts = {}, events = events, platform = "posix" }; | |
| 64 | |
| 63 local data_path = config.get("*", "core", "data_path") or CFG_DATADIR or "data"; | 65 local data_path = config.get("*", "core", "data_path") or CFG_DATADIR or "data"; |
| 64 require "util.datamanager".set_data_path(data_path); | 66 require "util.datamanager".set_data_path(data_path); |
| 65 | 67 |
| 66 -- Switch away from root and into the prosody user -- | 68 -- Switch away from root and into the prosody user -- |
| 67 local switched_user, current_uid; | 69 local switched_user, current_uid; |
| 109 ["not-running"] = "Prosody is not running"; | 111 ["not-running"] = "Prosody is not running"; |
| 110 }, { __index = function (t,k) return "Error: "..(tostring(k):gsub("%-", " "):gsub("^.", string.upper)); end }); | 112 }, { __index = function (t,k) return "Error: "..(tostring(k):gsub("%-", " "):gsub("^.", string.upper)); end }); |
| 111 | 113 |
| 112 local events = require "util.events".new(); | 114 local events = require "util.events".new(); |
| 113 | 115 |
| 114 hosts = {}; | 116 hosts = prosody.hosts; |
| 115 prosody = { hosts = hosts, events = events }; | |
| 116 | 117 |
| 117 for hostname, config in pairs(config.getconfig()) do | 118 for hostname, config in pairs(config.getconfig()) do |
| 118 hosts[hostname] = { events = events }; | 119 hosts[hostname] = { events = events }; |
| 119 end | 120 end |
| 120 | 121 |