Comparison

plugins/mod_posix.lua @ 1100:05d209ef9661

Merge with 0.4
author Matthew Wild <mwild1@gmail.com>
date Sun, 03 May 2009 01:11:21 +0100
parent 1066:0cb325970a50
parent 1092:b547967d87fc
child 1119:61a011ebe243
comparison
equal deleted inserted replaced
1088:7cf44a5c0991 1100:05d209ef9661
11 11
12 local config_get = require "core.configmanager".get; 12 local config_get = require "core.configmanager".get;
13 local logger_set = require "util.logger".setwriter; 13 local logger_set = require "util.logger".setwriter;
14 14
15 module.host = "*"; -- we're a global module 15 module.host = "*"; -- we're a global module
16
17 -- Don't even think about it!
18 module:add_event_hook("server-starting", function ()
19 if pposix.getuid() == 0 and not config_get("*", "core", "run_as_root") then
20 module:log("error", "Danger, Will Robinson! Prosody doesn't need to be run as root, so don't do it!");
21 module:log("error", "For more information on running Prosody as root, see http://prosody.im/doc/root");
22 _G.prosody_shutdown("Refusing to run as root");
23 end
24 end);
16 25
17 local pidfile_written; 26 local pidfile_written;
18 27
19 local function remove_pidfile() 28 local function remove_pidfile()
20 if pidfile_written then 29 if pidfile_written then