Changeset

9781:161411a41377

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.
author Kim Alvefur <zash@zash.se>
date Thu, 10 Jan 2019 14:57:26 +0100
parents 9780:c7727c13260f
children 9782:d844e197eedf
files util/prosodyctl.lua
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/util/prosodyctl.lua	Thu Jan 10 14:54:34 2019 +0100
+++ b/util/prosodyctl.lua	Thu Jan 10 14:57:26 2019 +0100
@@ -229,7 +229,8 @@
 	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 @@
 		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