def terminate_process():
     if m2ee:
         runtime.shutdown(m2ee, 10)
     else:
         logging.warning(
             "Cannot terminate runtime: M2EE client not set"
         )
     try:
         process_group = os.getpgrp()
         logging.debug(
             "Terminating process group with PGID [%s]",
             format(process_group),
         )
         os.killpg(process_group, signal.SIGTERM)
         time.sleep(3)
         logging.debug(
             "Killing process group with PGID [%s]",
             format(process_group),
         )
         os.killpg(process_group, signal.SIGKILL)
     except OSError as error:
         logging.debug(
             "Failed to terminate or kill complete process group: {}".format(
                 error
             )
         )
Exemple #2
0
        def restart_callback():
            global app_is_restarting

            if not m2ee:
                logging.warning("M2EE client not set")
            app_is_restarting = True
            if not runtime.shutdown(m2ee, 10):
                logging.warning("Could not kill runtime with M2EE")
            runtime.complete_start_procedure_safe_to_use_for_restart(m2ee)
            app_is_restarting = False