private static void stopInstallerIfKilled(Manager manager) {
        Runtime.getRuntime().addShutdownHook(new Thread(() -> {
            try {
                LOGGER.info("stopping installer gracefully");
                manager.stop();
                AuditUtils.send();
            } catch (Exception ex) {
                LOGGER.error("stop installer manager error: ", ex);
            }
        }));
    }
Stopping installer manager gracefully if it was killed.

@param manager installer manager
inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/Main.java