Diff

util/prosodyctl.lua @ 3627:9e62937c9757

prosodyctl, util.prosodyctl: Show error when mod_posix is not enabled and an attempt is made to query Prosody's status (thanks stever)
author Matthew Wild <mwild1@gmail.com>
date Tue, 16 Nov 2010 13:30:27 +0000
parent 3307:3d7acda82eed
child 3711:2a1cfaf3ee61
line wrap: on
line diff
--- 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;