Software /
code /
prosody
Diff
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 |
line wrap: on
line diff
--- a/plugins/mod_posix.lua Sat May 02 17:03:48 2009 +0100 +++ b/plugins/mod_posix.lua Sun May 03 01:11:21 2009 +0100 @@ -14,6 +14,15 @@ module.host = "*"; -- we're a global module +-- Don't even think about it! +module:add_event_hook("server-starting", function () + if pposix.getuid() == 0 and not config_get("*", "core", "run_as_root") then + module:log("error", "Danger, Will Robinson! Prosody doesn't need to be run as root, so don't do it!"); + module:log("error", "For more information on running Prosody as root, see http://prosody.im/doc/root"); + _G.prosody_shutdown("Refusing to run as root"); + end + end); + local pidfile_written; local function remove_pidfile()