马赛克问题

2020-12-16 16:43:21 recorder.sh: lvyunxiang test stop input in stop() ,pid_file is /usr/local/yckj/tmp/mosaic_input_1_11.pid,the pid is 4539
2020-12-16 16:43:22 recorder.sh: lvyunxiang test stop input in stop() ,pid_file is /usr/local/yckj/tmp/mosaic_input_1_12.pid,the pid is 4557
2020-12-16 16:43:23 recorder.sh: lvyunxiang test stop input in stop() ,pid_file is /usr/local/yckj/tmp/mosaic_input_1_2.pid,the pid is 4350
2020-12-16 16:43:24 recorder.sh: lvyunxiang test stop input in stop() ,pid_file is /usr/local/yckj/tmp/mosaic_input_1_3.pid,the pid is 4371
2020-12-16 16:43:25 recorder.sh: lvyunxiang test stop input in stop() ,pid_file is /usr/local/yckj/tmp/mosaic_input_1_4.pid,the pid is 3981
2020-12-16 16:43:26 recorder.sh: lvyunxiang test stop input in stop() ,pid_file is /usr/local/yckj/tmp/mosaic_input_1_5.pid,the pid is 47120
2020-12-16 16:43:27 recorder.sh: lvyunxiang test stop input in stop() ,pid_file is /usr/local/yckj/tmp/mosaic_input_1_6.pid,the pid is 47143
2020-12-16 16:43:28 recorder.sh: lvyunxiang test stop input in stop() ,pid_file is /usr/local/yckj/tmp/mosaic_input_1_7.pid,the pid is 47166
2020-12-16 16:43:29 recorder.sh: lvyunxiang test stop input in stop() ,pid_file is /usr/local/yckj/tmp/mosaic_input_1_8.pid,the pid is 47190
2020-12-16 16:43:29 recorder.sh: lvyunxiang test stop input in stop() ,pid_file is /usr/local/yckj/tmp/mosaic_input_1_9.pid,the pid is 47213
2020-12-16 16:45:04 recorder.sh: lvyunxiang test start transcoder pid file is /usr/local/yckj/tmp/transcode_tool_1.pid pid=18646
2020-12-16 16:45:04 recorder.sh: lvyunxiang test start input pid file is /usr/local/yckj/tmp/mosaic_input_1_1.pid,pid=18669
2020-12-16 16:45:04 recorder.sh: lvyunxiang test start input pid file is /usr/local/yckj/tmp/mosaic_input_1_2.pid,pid=18691
2020-12-16 16:45:04 recorder.sh: lvyunxiang test start input pid file is /usr/local/yckj/tmp/mosaic_input_1_3.pid,pid=18712
2020-12-16 16:45:04 recorder.sh: lvyunxiang test start input pid file is /usr/local/yckj/tmp/mosaic_input_1_4.pid,pid=18733
2020-12-16 16:45:04 recorder.sh: lvyunxiang test start input pid file is /usr/local/yckj/tmp/mosaic_input_1_5.pid,pid=18757
2020-12-16 16:45:04 recorder.sh: lvyunxiang test start input pid file is /usr/local/yckj/tmp/mosaic_input_1_6.pid,pid=18780
2020-12-16 16:45:04 recorder.sh: lvyunxiang test start input pid file is /usr/local/yckj/tmp/mosaic_input_1_7.pid,pid=18803
2020-12-16 16:45:04 recorder.sh: lvyunxiang test start input pid file is /usr/local/yckj/tmp/mosaic_input_1_8.pid,pid=18828
2020-12-16 16:45:04 recorder.sh: lvyunxiang test start input pid file is /usr/local/yckj/tmp/mosaic_input_1_9.pid,pid=18852
2020-12-16 16:45:04 recorder.sh: lvyunxiang test start input pid file is /usr/local/yckj/tmp/mosaic_input_1_10.pid,pid=18872
2020-12-16 16:45:04 recorder.sh: lvyunxiang test start input pid file is /usr/local/yckj/tmp/mosaic_input_1_11.pid,pid=18892
2020-12-16 16:45:04 recorder.sh: lvyunxiang test start input pid file is /usr/local/yckj/tmp/mosaic_input_1_12.pid,pid=18911
2020-12-16 16:46:15 recorder.sh: lvyunxiang test kill -9 18385,0,
2020-12-16 16:46:15 recorder.sh: lvyunxiang test stop channel 1 pid_file is /usr/local/yckj/tmp/output_1.pid pid is  18385
2020-12-16 16:46:18 recorder.sh: lvyunxiang test kill -9 18646,0,
2020-12-16 16:46:21 recorder.sh: lvyunxiang test kill -9 18669,0,
2020-12-16 16:46:21 recorder.sh: lvyunxiang test stop input in stop() ,pid_file is /usr/local/yckj/tmp/mosaic_input_1_1.pid,the pid is 18669
2020-12-16 16:46:24 recorder.sh: lvyunxiang test kill -9 18872,0,
2020-12-16 16:46:24 recorder.sh: lvyunxiang test stop input in stop() ,pid_file is /usr/local/yckj/tmp/mosaic_input_1_10.pid,the pid is 18872
2020-12-16 16:46:27 recorder.sh: lvyunxiang test kill -9 18892,0,
2020-12-16 16:46:27 recorder.sh: lvyunxiang test stop input in stop() ,pid_file is /usr/local/yckj/tmp/mosaic_input_1_11.pid,the pid is 18892
2020-12-16 16:46:28 recorder.sh: lvyunxiang test kill -9 29792,0,
2020-12-16 16:46:29 recorder.sh: lvyunxiang test start transcoder pid file is /usr/local/yckj/tmp/transcode_tool_1.pid pid=31784
2020-12-16 16:46:29 recorder.sh: lvyunxiang test start input pid file is /usr/local/yckj/tmp/mosaic_input_1_1.pid,pid=31806
2020-12-16 16:46:29 recorder.sh: lvyunxiang test start input pid file is /usr/local/yckj/tmp/mosaic_input_1_2.pid,pid=18691
2020-12-16 16:46:29 recorder.sh: lvyunxiang test start input pid file is /usr/local/yckj/tmp/mosaic_input_1_3.pid,pid=18712
2020-12-16 16:46:29 recorder.sh: lvyunxiang test start input pid file is /usr/local/yckj/tmp/mosaic_input_1_4.pid,pid=18733
2020-12-16 16:46:29 recorder.sh: lvyunxiang test start input pid file is /usr/local/yckj/tmp/mosaic_input_1_5.pid,pid=18757
2020-12-16 16:46:29 recorder.sh: lvyunxiang test start input pid file is /usr/local/yckj/tmp/mosaic_input_1_6.pid,pid=18780
2020-12-16 16:46:29 recorder.sh: lvyunxiang test start input pid file is /usr/local/yckj/tmp/mosaic_input_1_7.pid,pid=18803
2020-12-16 16:46:29 recorder.sh: lvyunxiang test start input pid file is /usr/local/yckj/tmp/mosaic_input_1_8.pid,pid=18828
2020-12-16 16:46:29 recorder.sh: lvyunxiang test start input pid file is /usr/local/yckj/tmp/mosaic_input_1_9.pid,pid=18852
2020-12-16 16:46:29 recorder.sh: lvyunxiang test start input pid file is /usr/local/yckj/tmp/mosaic_input_1_10.pid,pid=32068
2020-12-16 16:46:29 recorder.sh: lvyunxiang test start input pid file is /usr/local/yckj/tmp/mosaic_input_1_11.pid,pid=32104
2020-12-16 16:46:29 recorder.sh: lvyunxiang test start input pid file is /usr/local/yckj/tmp/mosaic_input_1_12.pid,pid=18911

 

 

 

 

 

 

 

 

 

 

 

 

 

修改成了这种

if [ "$ACTION" != "status" ]; then
    try_count=0
    while true
    do
        if [ -f $script_pid_file ]; then
            record_pid=`cat $script_pid_file`
            if [ -n "$record_pid" ];then
                cmd_line=`cat /proc/$record_pid/cmdline | grep record`
                if [ -f /etc/redhat-release ];then
                    cmd_line=`cat /proc/$record_pid/cmdline | strings -1 | grep record`
                fi
                if [ -d /proc/$record_pid ]  && [ "$cmd_line" == "/record/scripts/record.sh" ];then
                    log_info "process $record_pid of record.sh is running"
                    let try_count=$try_count+1
                    sleep 1
                    if [ "$waits" == "3" ];then
                        log_info "process $record_pid of record.sh is running,exit"
                        exit 1
                    fi
                else #process is not record.sh
                    rm -rf $script_pid_file
                    break
                fi
            else #pid is null
                rm -rf $script_pid_file
                break
            fi
        else #script_pid_file not exist
            break
        fi
    done
    # record encoder self pid
    echo $$ > $script_pid_file
fi

 

posted @ 2020-12-16 17:21  虾兵  阅读(70)  评论(0编辑  收藏  举报