KIBANA-6.4.x/package/scripts/kibana_server.py
def stop(self, env):
        import params
        env.set_params(params)

        # Stop Kibana
        """
            Kill the process by pid file, then check the process is running or not. If the process is still running after the kill
            command, it will try to kill with -9 option (hard kill)
            """
        pid_file = params.pid_file
        pid = os.popen('cat {pid_file}'.format(pid_file=pid_file)).read()

        process_id_exists_command = format("ls {pid_file} >/dev/null 2>&1 && ps -p {pid} >/dev/null 2>&1")

        kill_cmd = format("kill {pid}")
        Execute(kill_cmd,
                not_if=format("! ({process_id_exists_command})"))
        wait_time = 5

        hard_kill_cmd = format("kill -9 {pid}")
        Execute(hard_kill_cmd,
                not_if=format(
                    "! ({process_id_exists_command}) || ( sleep {wait_time} && ! ({process_id_exists_command}) )"),
                ignore_failures=True)
        try:
            Execute(format("! ({process_id_exists_command})"),
                    tries=20,
                    try_sleep=3,
                    )
        except:
            show_logs(params.logging_dest_dir, params.kibana_user)
            raise

        File(pid_file,
             action="delete"
             )

            Kill the process by pid file, then check the process is running or not. If the process is still running after the kill
            command, it will try to kill with -9 option (hard kill)
            
Kill the process by pid file, then check the process is running or not. If the process is still running after the kill
command, it will try to kill with -9 option (hard kill)
Kill the process by pid file then check the process is running or not . If the process is still running after the kill command it will try to kill with - 9 option ( hard kill )
def stop(self, env):
        import params
        env.set_params(params)
        pid_file = params.pid_file
        pid = os.popen('cat {pid_file}'.format(pid_file=pid_file)).read()
        process_id_exists_command = format("ls {pid_file} >/dev/null 2>&1 && ps -p {pid} >/dev/null 2>&1")
        kill_cmd = format("kill {pid}")
        Execute(kill_cmd,
                not_if=format("! ({process_id_exists_command})"))
        wait_time = 5
        hard_kill_cmd = format("kill -9 {pid}")
        Execute(hard_kill_cmd,
                not_if=format(
                    "! ({process_id_exists_command}) || ( sleep {wait_time} && ! ({process_id_exists_command}) )"),
                ignore_failures=True)
        try:
            Execute(format("! ({process_id_exists_command})"),
                    tries=20,
                    try_sleep=3,
                    )
        except:
            show_logs(params.logging_dest_dir, params.kibana_user)
            raise
        File(pid_file,
             action="delete"
             )
def stop ( self , env ) : import params env . set_params ( params ) pid_file = params . pid_file pid = os . popen ( 'cat {pid_file}' . format ( pid_file = pid_file ) ) . read ( ) process_id_exists_command = format ( "ls {pid_file} >/dev/null 2>&1 && ps -p {pid} >/dev/null 2>&1" ) kill_cmd = format ( "kill {pid}" ) Execute ( kill_cmd , not_if = format ( "! ({process_id_exists_command})" ) ) wait_time = 5 hard_kill_cmd = format ( "kill -9 {pid}" ) Execute ( hard_kill_cmd , not_if = format ( "! ({process_id_exists_command}) || ( sleep {wait_time} && ! ({process_id_exists_command}) )" ) , ignore_failures = True ) try : Execute ( format ( "! ({process_id_exists_command})" ) , tries = 20 , try_sleep = 3 , ) except : show_logs ( params . logging_dest_dir , params . kibana_user ) raise File ( pid_file , action = "delete" )
Kill the process by pid file, then check the process is running or not.
Kill the process by pid file then check the process is running or not .
# Stop Kibana """
            Kill the process by pid file, then check the process is running or not. If the process is still running after the kill
            command, it will try to kill with -9 option (hard kill)
            """
self
env