aboutsummaryrefslogtreecommitdiffstats
path: root/util/prosodyctl.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-01-10 14:57:26 +0100
committerKim Alvefur <zash@zash.se>2019-01-10 14:57:26 +0100
commit8d8c6bd619ded1b202ebd19bda33bde475c4c37d (patch)
treed1acc3ff39e4c6a613074a984c517f7d0a5a3ac7 /util/prosodyctl.lua
parente31667cf151d9d81cf2ab16eece72e559983fb52 (diff)
downloadprosody-8d8c6bd619ded1b202ebd19bda33bde475c4c37d.tar.gz
prosody-8d8c6bd619ded1b202ebd19bda33bde475c4c37d.zip
util.prosodyctl: Allow passing path to Lua runtime to the start() function
By default the shebang is used. Being able to override it is useful in cases where the shebang does not match the configured runtime.
Diffstat (limited to 'util/prosodyctl.lua')
-rw-r--r--util/prosodyctl.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/util/prosodyctl.lua b/util/prosodyctl.lua
index 5f0c4d12..9b627bde 100644
--- a/util/prosodyctl.lua
+++ b/util/prosodyctl.lua
@@ -229,7 +229,8 @@ local function isrunning()
return true, signal.kill(pid, 0) == 0;
end
-local function start(source_dir)
+local function start(source_dir, lua)
+ lua = lua and lua .. " " or "";
local ok, ret = isrunning();
if not ok then
return ok, ret;
@@ -238,9 +239,9 @@ local function start(source_dir)
return false, "already-running";
end
if not source_dir then
- os.execute("./prosody");
+ os.execute(lua .. "./prosody");
else
- os.execute(source_dir.."/../../bin/prosody");
+ os.execute(lua .. source_dir.."/../../bin/prosody");
end
return true;
end