diff options
-rw-r--r-- | plugins/mod_posix.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/mod_posix.lua b/plugins/mod_posix.lua index 52b1e0e6..11e3c418 100644 --- a/plugins/mod_posix.lua +++ b/plugins/mod_posix.lua @@ -95,6 +95,11 @@ local function write_pidfile() pidfile_handle = nil; prosody.shutdown("Prosody already running"); else + pidfile_handle, err = io.open(pidfile, "w+"); + if not pidfile_handle then + module:log("error", "Couldn't write pidfile at %s; %s", pidfile, err); + prosody.shutdown("Couldn't write pidfile"); + end pidfile_handle:write(tostring(pposix.getpid())); pidfile_handle:flush(); end |