diff options
author | Vladimir Protasov <eoranged@ya.ru> | 2011-08-04 21:26:15 +0400 |
---|---|---|
committer | Vladimir Protasov <eoranged@ya.ru> | 2011-08-04 21:26:15 +0400 |
commit | e07ca0e54999e7e09b9c1f73709828ebc1b95e7f (patch) | |
tree | 710127305f28052eb782d092c9ceda8c29cf5123 /util/prosodyctl.lua | |
parent | d305ad9eda1ab8cd61b65a4e5f6b85a4a40c6655 (diff) | |
download | prosody-e07ca0e54999e7e09b9c1f73709828ebc1b95e7f.tar.gz prosody-e07ca0e54999e7e09b9c1f73709828ebc1b95e7f.zip |
Add "reload" command to prosodyctl
Diffstat (limited to 'util/prosodyctl.lua')
-rw-r--r-- | util/prosodyctl.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/util/prosodyctl.lua b/util/prosodyctl.lua index aa1850b2..d0045abc 100644 --- a/util/prosodyctl.lua +++ b/util/prosodyctl.lua @@ -238,3 +238,19 @@ function stop() signal.kill(pid, signal.SIGTERM); return true; end + +function reload() + local ok, ret = _M.isrunning(); + if not ok then + return ok, ret; + end + if not ret then + return false, "not-running"; + end + + local ok, pid = _M.getpid() + if not ok then return false, pid; end + + signal.kill(pid, signal.SIGHUP); + return true; +end |