Software /
code /
prosody
Comparison
plugins/mod_posix.lua @ 11062:dd3b1b9d867d
mod_posix: Daemonize later
Daemonizing later means we can use that as a "successful startup"
signal and problems can be reported via exit code.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 08 Sep 2020 22:50:43 +0200 |
parent | 11047:93cdd1ece689 |
child | 11179:96da09c771a1 |
comparison
equal
deleted
inserted
replaced
11060:19dd9522f107 | 11062:dd3b1b9d867d |
---|---|
115 else | 115 else |
116 module:log("info", "Successfully daemonized to PID %d", pposix.getpid()); | 116 module:log("info", "Successfully daemonized to PID %d", pposix.getpid()); |
117 write_pidfile(); | 117 write_pidfile(); |
118 end | 118 end |
119 end | 119 end |
120 if not prosody.start_time then -- server-starting | 120 module:hook("server-started", daemonize_server) |
121 daemonize_server(); | |
122 end | |
123 else | 121 else |
124 -- Not going to daemonize, so write the pid of this process | 122 -- Not going to daemonize, so write the pid of this process |
125 write_pidfile(); | 123 write_pidfile(); |
126 end | 124 end |
127 | 125 |