diff options
author | Matthew Wild <mwild1@gmail.com> | 2020-01-23 21:44:42 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2020-01-23 21:44:42 +0000 |
commit | 79d8e994a24c7ecc7cdad98e9182996b27970557 (patch) | |
tree | 31d22812184a710b674e6f300daee24811499e81 | |
parent | 94d54fd3c432cd72c437064f6f03c0cbc5fd6650 (diff) | |
parent | 23470dd8de09af826b3efd3cf0968ad4787831c0 (diff) | |
download | prosody-79d8e994a24c7ecc7cdad98e9182996b27970557.tar.gz prosody-79d8e994a24c7ecc7cdad98e9182996b27970557.zip |
Merge 0.11->trunk
-rwxr-xr-x | prosodyctl | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -222,11 +222,25 @@ function commands.deluser(arg) return 1; end +local function service_command_warning(command) + 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(" if Prosody is managed by an init system - use that directly instead."); + if lfs.attributes("/etc/systemd") then + show_warning(" e.g. systemctl %s prosody", command); + elseif lfs.attributes("/etc/init.d/prosody") then + show_warning(" e.g. /etc/init.d/prosody %s", command); + end + show_warning(""); + end +end + function commands.start(arg) if arg[1] == "--help" then show_usage([[start]], [[Start Prosody]]); return 1; end + service_command_warning("start"); local ok, ret = prosodyctl.isrunning(); if not ok then show_message(error_messages[ret]); @@ -325,6 +339,8 @@ function commands.stop(arg) return 1; end + service_command_warning("stop"); + if not prosodyctl.isrunning() then show_message("Prosody is not running"); return 1; @@ -360,6 +376,8 @@ function commands.restart(arg) return 1; end + service_command_warning("restart"); + commands.stop(arg); return commands.start(arg); end @@ -460,6 +478,8 @@ function commands.reload(arg) return 1; end + service_command_warning("reload"); + if not prosodyctl.isrunning() then show_message("Prosody is not running"); return 1; |