aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-03-22 21:54:59 +0000
committerMatthew Wild <mwild1@gmail.com>2018-03-22 21:54:59 +0000
commitc0912560a42d1ea8615a9806d3e92d743aed6bfb (patch)
tree7e309739e6e09b1a7499dc467bf58376b3322cdd
parent34473917a1c782b036b479c6268890d2ac29bf55 (diff)
downloadprosody-c0912560a42d1ea8615a9806d3e92d743aed6bfb.tar.gz
prosody-c0912560a42d1ea8615a9806d3e92d743aed6bfb.zip
prosodyctl, util.prosodyctl: Pass source path as a parameter instead of global variable
-rwxr-xr-xprosodyctl2
-rw-r--r--util/prosodyctl.lua8
2 files changed, 4 insertions, 6 deletions
diff --git a/prosodyctl b/prosodyctl
index 07b68e69..20aaae2f 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -219,7 +219,7 @@ function commands.start(arg)
return 1;
end
- local ok, ret = prosodyctl.start();
+ local ok, ret = prosodyctl.start(prosody.paths.source);
if ok then
local daemonize = config.get("*", "daemonize");
if daemonize == nil then
diff --git a/util/prosodyctl.lua b/util/prosodyctl.lua
index 0da28cfa..eee09762 100644
--- a/util/prosodyctl.lua
+++ b/util/prosodyctl.lua
@@ -24,8 +24,6 @@ local io, os = io, os;
local print = print;
local tonumber = tonumber;
-local CFG_SOURCEDIR = _G.CFG_SOURCEDIR;
-
local _G = _G;
local prosody = prosody;
@@ -231,7 +229,7 @@ local function isrunning()
return true, signal.kill(pid, 0) == 0;
end
-local function start()
+local function start(source_dir)
local ok, ret = isrunning();
if not ok then
return ok, ret;
@@ -239,10 +237,10 @@ local function start()
if ret then
return false, "already-running";
end
- if not CFG_SOURCEDIR then
+ if not source_dir then
os.execute("./prosody");
else
- os.execute(CFG_SOURCEDIR.."/../../bin/prosody");
+ os.execute(source_dir.."/../../bin/prosody");
end
return true;
end