Software /
code /
prosody
Comparison
plugins/mod_posix.lua @ 8168:45be94611593
Merge 0.10->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 13 Jun 2017 20:14:06 +0200 |
parent | 8121:a33a87f13155 |
parent | 8167:39188851811c |
child | 8235:7d9a2c200736 |
comparison
equal
deleted
inserted
replaced
8165:e564f13b9582 | 8168:45be94611593 |
---|---|
9 | 9 |
10 local want_pposix_version = "0.4.0"; | 10 local want_pposix_version = "0.4.0"; |
11 | 11 |
12 local pposix = assert(require "util.pposix"); | 12 local pposix = assert(require "util.pposix"); |
13 if pposix._VERSION ~= want_pposix_version then | 13 if pposix._VERSION ~= want_pposix_version then |
14 module:log("warn", "Unknown version (%s) of binary pposix module, expected %s. Perhaps you need to recompile?", tostring(pposix._VERSION), want_pposix_version); | 14 module:log("warn", "Unknown version (%s) of binary pposix module, expected %s." |
15 .. "Perhaps you need to recompile?", tostring(pposix._VERSION), want_pposix_version); | |
15 end | 16 end |
16 | 17 |
17 local have_signal, signal = pcall(require, "util.signal"); | 18 local have_signal, signal = pcall(require, "util.signal"); |
18 if not have_signal then | 19 if not have_signal then |
19 module:log("warn", "Couldn't load signal library, won't respond to SIGTERM"); | 20 module:log("warn", "Couldn't load signal library, won't respond to SIGTERM"); |
110 end | 111 end |
111 end | 112 end |
112 end | 113 end |
113 | 114 |
114 local syslog_opened; | 115 local syslog_opened; |
115 function syslog_sink_maker(config) | 116 function syslog_sink_maker(config) -- luacheck: ignore 212/config |
116 if not syslog_opened then | 117 if not syslog_opened then |
117 pposix.syslog_open("prosody", module:get_option_string("syslog_facility")); | 118 pposix.syslog_open("prosody", module:get_option_string("syslog_facility")); |
118 syslog_opened = true; | 119 syslog_opened = true; |
119 end | 120 end |
120 local syslog, format = pposix.syslog_log, string.format; | 121 local syslog, format = pposix.syslog_log, string.format; |