Merge "sd_notify (systemd status notifications) support"

This commit is contained in:
zuul
2016-09-20 11:19:02 -05:00
committed by Gerrit Code Review
10 changed files with 163 additions and 6 deletions

View File

@@ -2039,6 +2039,9 @@ static void really_quit(int num, shutdown_nice_t niceness, int restart)
ast_module_shutdown();
}
if (!restart) {
ast_sd_notify("STOPPING=1");
}
if (ast_opt_console || (ast_opt_remote && !ast_opt_exec)) {
ast_el_write_default_histfile();
if (consolethread == AST_PTHREADT_NULL || consolethread == pthread_self()) {
@@ -4566,6 +4569,7 @@ static void asterisk_daemon(int isroot, const char *runuser, const char *rungrou
ast_register_cleanup(main_atexit);
run_startup_commands();
ast_sd_notify("READY=1");
ast_verb(0, COLORIZE_FMT "\n", COLORIZE(COLOR_BRGREEN, 0, "Asterisk Ready."));