aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-11-16 13:30:27 +0000
committerMatthew Wild <mwild1@gmail.com>2010-11-16 13:30:27 +0000
commit07243fc7d1fa26213c38130d30e26774a06ac018 (patch)
tree0728c38205c89317474ddb15af714528f1ac90a3 /util
parentdb4d9e500c0ec9376de8ebbd18e7d79ff9fbb722 (diff)
downloadprosody-07243fc7d1fa26213c38130d30e26774a06ac018.tar.gz
prosody-07243fc7d1fa26213c38130d30e26774a06ac018.zip
prosodyctl, util.prosodyctl: Show error when mod_posix is not enabled and an attempt is made to query Prosody's status (thanks stever)
Diffstat (limited to 'util')
-rw-r--r--util/prosodyctl.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/util/prosodyctl.lua b/util/prosodyctl.lua
index 7f3ce20e..f6cb8d7f 100644
--- a/util/prosodyctl.lua
+++ b/util/prosodyctl.lua
@@ -12,6 +12,7 @@ local encodings = require "util.encodings";
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 @@ function getpid()
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;