# HG changeset patch # User Matthew Wild # Date 1289914227 0 # Node ID 9e62937c9757484192deeebf6742a3205896b7ff # Parent 444f965baed8ad323c29c6155525e69716ff5abf prosodyctl, util.prosodyctl: Show error when mod_posix is not enabled and an attempt is made to query Prosody's status (thanks stever) diff -r 444f965baed8 -r 9e62937c9757 prosodyctl --- a/prosodyctl Sat Nov 13 23:10:50 2010 +0000 +++ b/prosodyctl Tue Nov 16 13:30:27 2010 +0000 @@ -160,6 +160,7 @@ ["no-such-user"] = "The given user does not exist on the server"; ["unable-to-save-data"] = "Unable to store, perhaps you don't have permission?"; ["no-pidfile"] = "There is no 'pidfile' option in the configuration file, see http://prosody.im/doc/prosodyctl#pidfile for help"; + ["no-posix"] = "The mod_posix module is not enabled in the Prosody config file, see http://prosody.im/doc/prosodyctl for more info"; ["no-such-method"] = "This module has no commands"; ["not-running"] = "Prosody is not running"; }, { __index = function (t,k) return "Error: "..(tostring(k):gsub("%-", " "):gsub("^.", string.upper)); end }); diff -r 444f965baed8 -r 9e62937c9757 util/prosodyctl.lua --- a/util/prosodyctl.lua Sat Nov 13 23:10:50 2010 +0000 +++ b/util/prosodyctl.lua Tue Nov 16 13:30:27 2010 +0000 @@ -12,6 +12,7 @@ local stringprep = encodings.stringprep; local usermanager = require "core.usermanager"; local signal = require "util.signal"; +local set = require "util.set"; local lfs = require "lfs"; local nodeprep, nameprep = stringprep.nodeprep, stringprep.nameprep; @@ -77,6 +78,11 @@ return false, "no-pidfile"; end + local modules_enabled = set.new(config.get("*", "core", "modules_enabled")); + if not modules_enabled:contains("posix") then + return false, "no-posix"; + end + local file, err = io.open(pidfile, "r+"); if not file then return false, "pidfile-read-failed", err;