Software /
code /
prosody
Comparison
util/prosodyctl.lua @ 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 |
parent | 8883:3f975bbfec3b |
child | 10132:b59535964e81 |
comparison
equal
deleted
inserted
replaced
9780:c7727c13260f | 9781:161411a41377 |
---|---|
227 return ok, pid; | 227 return ok, pid; |
228 end | 228 end |
229 return true, signal.kill(pid, 0) == 0; | 229 return true, signal.kill(pid, 0) == 0; |
230 end | 230 end |
231 | 231 |
232 local function start(source_dir) | 232 local function start(source_dir, lua) |
233 lua = lua and lua .. " " or ""; | |
233 local ok, ret = isrunning(); | 234 local ok, ret = isrunning(); |
234 if not ok then | 235 if not ok then |
235 return ok, ret; | 236 return ok, ret; |
236 end | 237 end |
237 if ret then | 238 if ret then |
238 return false, "already-running"; | 239 return false, "already-running"; |
239 end | 240 end |
240 if not source_dir then | 241 if not source_dir then |
241 os.execute("./prosody"); | 242 os.execute(lua .. "./prosody"); |
242 else | 243 else |
243 os.execute(source_dir.."/../../bin/prosody"); | 244 os.execute(lua .. source_dir.."/../../bin/prosody"); |
244 end | 245 end |
245 return true; | 246 return true; |
246 end | 247 end |
247 | 248 |
248 local function stop() | 249 local function stop() |