# HG changeset patch # User Matthew Wild # Date 1579816783 0 # Node ID c10511380c0ffcf453beb845d2aca48a6a0630d2 # Parent f35cbfe546d1aa98657c7309b4e0951563c9df5a# Parent b9a054ad38e72c0480534c06a7b4397c048d122a Merge 0.11->trunk diff -r f35cbfe546d1 -r c10511380c0f prosodyctl --- a/prosodyctl Thu Jan 23 21:44:42 2020 +0000 +++ b/prosodyctl Thu Jan 23 21:59:43 2020 +0000 @@ -68,6 +68,7 @@ local prosodyctl = require "util.prosodyctl" local socket = require "socket" local dependencies = require "util.dependencies"; +local lfs = dependencies.softreq "lfs"; ----------------------- @@ -222,14 +223,15 @@ return 1; end -local function service_command_warning(command) +local function service_command_warning(service_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."); + lfs = lfs or require if lfs.attributes("/etc/systemd") then - show_warning(" e.g. systemctl %s prosody", command); + show_warning(" e.g. systemctl %s prosody", service_command); elseif lfs.attributes("/etc/init.d/prosody") then - show_warning(" e.g. /etc/init.d/prosody %s", command); + show_warning(" e.g. /etc/init.d/prosody %s", service_command); end show_warning(""); end @@ -551,7 +553,6 @@ end local openssl; -local lfs; local cert_commands = {};