Software /
code /
prosody
Comparison
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 |
comparison
equal
deleted
inserted
replaced
3626:444f965baed8 | 3627:9e62937c9757 |
---|---|
10 local config = require "core.configmanager"; | 10 local config = require "core.configmanager"; |
11 local encodings = require "util.encodings"; | 11 local encodings = require "util.encodings"; |
12 local stringprep = encodings.stringprep; | 12 local stringprep = encodings.stringprep; |
13 local usermanager = require "core.usermanager"; | 13 local usermanager = require "core.usermanager"; |
14 local signal = require "util.signal"; | 14 local signal = require "util.signal"; |
15 local set = require "util.set"; | |
15 local lfs = require "lfs"; | 16 local lfs = require "lfs"; |
16 | 17 |
17 local nodeprep, nameprep = stringprep.nodeprep, stringprep.nameprep; | 18 local nodeprep, nameprep = stringprep.nodeprep, stringprep.nameprep; |
18 | 19 |
19 local io, os = io, os; | 20 local io, os = io, os; |
73 | 74 |
74 function getpid() | 75 function getpid() |
75 local pidfile = config.get("*", "core", "pidfile"); | 76 local pidfile = config.get("*", "core", "pidfile"); |
76 if not pidfile then | 77 if not pidfile then |
77 return false, "no-pidfile"; | 78 return false, "no-pidfile"; |
79 end | |
80 | |
81 local modules_enabled = set.new(config.get("*", "core", "modules_enabled")); | |
82 if not modules_enabled:contains("posix") then | |
83 return false, "no-posix"; | |
78 end | 84 end |
79 | 85 |
80 local file, err = io.open(pidfile, "r+"); | 86 local file, err = io.open(pidfile, "r+"); |
81 if not file then | 87 if not file then |
82 return false, "pidfile-read-failed", err; | 88 return false, "pidfile-read-failed", err; |