Mercurial > prosody-hg
comparison util/startup.lua @ 12554:dbbbcf6b805e
Merge 0.12->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 14 Jun 2022 19:21:20 +0200 |
| parents | cc0ec0277813 |
| children | f0474d40364c |
comparison
equal
deleted
inserted
replaced
| 12552:b4bc5a715e65 | 12554:dbbbcf6b805e |
|---|---|
| 351 prosody.shutdown_code = code; | 351 prosody.shutdown_code = code; |
| 352 prosody.events.fire_event("server-stopping", { | 352 prosody.events.fire_event("server-stopping", { |
| 353 reason = reason; | 353 reason = reason; |
| 354 code = code; | 354 code = code; |
| 355 }); | 355 }); |
| 356 server.setquitting(true); | 356 prosody.main_thread:run(startup.shutdown); |
| 357 end | 357 end |
| 358 end | 358 end |
| 359 | 359 |
| 360 function startup.load_secondary_libraries() | 360 function startup.load_secondary_libraries() |
| 361 --- Load and initialise core modules | 361 --- Load and initialise core modules |
| 642 prosody.events.fire_event("server-stopped"); | 642 prosody.events.fire_event("server-stopped"); |
| 643 prosody.log("info", "Shutdown complete"); | 643 prosody.log("info", "Shutdown complete"); |
| 644 | 644 |
| 645 prosody.log("debug", "Shutdown reason was: %s", prosody.shutdown_reason or "not specified"); | 645 prosody.log("debug", "Shutdown reason was: %s", prosody.shutdown_reason or "not specified"); |
| 646 prosody.log("debug", "Exiting with status code: %d", prosody.shutdown_code or 0); | 646 prosody.log("debug", "Exiting with status code: %d", prosody.shutdown_code or 0); |
| 647 server.setquitting(true); | |
| 648 end | |
| 649 | |
| 650 function startup.exit() | |
| 647 os.exit(prosody.shutdown_code); | 651 os.exit(prosody.shutdown_code); |
| 648 end | 652 end |
| 649 | 653 |
| 650 -- prosodyctl only | 654 -- prosodyctl only |
| 651 function startup.prosodyctl() | 655 function startup.prosodyctl() |
