mirror of
https://github.com/bjc/prosody.git
synced 2025-04-04 05:37:39 +03:00
Merge 0.11->trunk
This commit is contained in:
commit
da8329037d
2 changed files with 19 additions and 1 deletions
|
@ -89,6 +89,9 @@ local default_config = { __index = {
|
||||||
|
|
||||||
-- Reuse write buffer tables
|
-- Reuse write buffer tables
|
||||||
keep_buffers = true;
|
keep_buffers = true;
|
||||||
|
|
||||||
|
--- How long to wait after getting the shutdown signal before forcefully tearing down every socket
|
||||||
|
shutdown_deadline = 5;
|
||||||
}};
|
}};
|
||||||
local cfg = default_config.__index;
|
local cfg = default_config.__index;
|
||||||
|
|
||||||
|
@ -1004,6 +1007,21 @@ local function setquitting(quit)
|
||||||
if quit then
|
if quit then
|
||||||
quitting = "quitting";
|
quitting = "quitting";
|
||||||
closeall();
|
closeall();
|
||||||
|
addtimer(1, function ()
|
||||||
|
if quitting then
|
||||||
|
closeall();
|
||||||
|
return 1;
|
||||||
|
end
|
||||||
|
end);
|
||||||
|
if cfg.shutdown_deadline then
|
||||||
|
addtimer(cfg.shutdown_deadline, function ()
|
||||||
|
if quitting then
|
||||||
|
for fd, conn in pairs(fds) do -- luacheck: ignore 213/fd
|
||||||
|
conn:destroy();
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end);
|
||||||
|
end
|
||||||
else
|
else
|
||||||
quitting = nil;
|
quitting = nil;
|
||||||
end
|
end
|
||||||
|
|
|
@ -230,7 +230,7 @@ local function service_command_warning(service_command)
|
||||||
if prosody.installed and configmanager.get("*", "prosodyctl_service_warnings") ~= false then
|
if prosody.installed and configmanager.get("*", "prosodyctl_service_warnings") ~= false then
|
||||||
show_warning("WARNING: Use of prosodyctl start/stop/restart/reload is not recommended");
|
show_warning("WARNING: Use of prosodyctl start/stop/restart/reload is not recommended");
|
||||||
show_warning(" if Prosody is managed by an init system - use that directly instead.");
|
show_warning(" if Prosody is managed by an init system - use that directly instead.");
|
||||||
lfs = lfs or require
|
lfs = lfs or require"lfs";
|
||||||
if lfs.attributes("/etc/systemd") then
|
if lfs.attributes("/etc/systemd") then
|
||||||
show_warning(" e.g. systemctl %s prosody", service_command);
|
show_warning(" e.g. systemctl %s prosody", service_command);
|
||||||
elseif lfs.attributes("/etc/init.d/prosody") then
|
elseif lfs.attributes("/etc/init.d/prosody") then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue