X7ROOT File Manager
Current Path:
/var/VMOptimizationToolsLinux
var
/
VMOptimizationToolsLinux
/
π
..
π
LinuxUpdate.XML
(645 B)
π
SangforVMSTool
(3.11 KB)
π
SangforVMSTool.service
(194 B)
π
action_common.sh
(13.34 KB)
π
busybox_cmd_ln.sh
(2.24 KB)
π
collect_test_data.sh
(1.16 KB)
π
common_config.sh
(278 B)
π
data_test_tool.sh
(12.59 KB)
π
debian_vmconfig.sh
(10.74 KB)
π
guest_system_config.sh
(1.82 KB)
π
log.sh
(1.36 KB)
π
mod_test.sh
(3.69 KB)
π
mod_test1.sh
(914 B)
π
net_common.sh
(915 B)
π
redhat_vmconfig.sh
(11.14 KB)
π
sangfor_guest_datareport
(21.66 KB)
π
sangfor_heartalive.sh
(2.37 KB)
π
sangfor_module_update
(28.11 KB)
π
sangfor_set_network.sh
(504 B)
π
sangfor_sfping
(3.85 KB)
π
sangfor_sshkey_gen
(1.29 KB)
π
sangfor_update_ipc_callback
(5.29 KB)
π
sangfor_vm_proxyd
(3.45 KB)
π
sangfor_vm_proxyd_r
(4.4 KB)
π
sangfor_vm_proxyd_w
(1.32 KB)
π
sangfor_vmconfig
(2.4 KB)
π
sangfor_vmconfig_common
(27.99 KB)
π
sangfor_vmconfig_ipc_callback
(4.75 KB)
π
sangfor_watchdog
(3.95 KB)
π
sfping.c
(15.68 KB)
π
sfping.pl
(6.15 KB)
π
startall
(1.78 KB)
π
stopall
(1.11 KB)
π
suse_vmconfig.sh
(6.19 KB)
π
tools_x64
π
tools_x86
π
uni_test.sh
(2.59 KB)
π
update_common_func
(4.35 KB)
π
update_common_header
(4.86 KB)
π
update_config
(2.89 KB)
π
update_install
(28.84 KB)
π
virtio_nic_attr_set.sh
(2.42 KB)
π
virtio_nic_compat.sh
(5.28 KB)
π
vm_ip_recover.sh
(16.66 KB)
π
vm_ipc.sh
(9.06 KB)
π
vmconfig_common_func
(10.76 KB)
π
vmconfig_common_header
(3.37 KB)
π
vmconfig_config
(805 B)
π
vmtools-install.sh
(31.16 KB)
π
watch_test.sh
(313 B)
π
watchdog.sh
(1.39 KB)
π
x64
π
x86
Editing: sangfor_vm_proxyd
#!/bin/bash # vm_proxyd module # current directory declare g_shell_dir=`dirname "$0"` . "${g_shell_dir}/log.sh" . "${g_shell_dir}/watchdog.sh" . "${g_shell_dir}/common_config.sh" # write process pid declare g_write_pid=0 # read process pid declare g_read_pid=0 # Identification of serial port is open declare g_has_open_serial=0 # FIXME: There may be two virtual serial port in VMP4.0. declare -r g_vportfile="/dev/virtio-ports/channelser.virtserial0.0" # kill process # If the process name and the current script name the same, don't kill yourself. # param $1: process name(without path) # return 0(success)οΌ1(failed) kill_process() { if [ $# -ne 1 ]; then log "parameter error!" return 1 fi local pid=$$ local procname=${1} # Here is pipe, so can't execution with awk because it will cause out of order. local ps_list=`ps ax | grep "${procname}\>" | grep -v grep | grep -v "\<${pid}\>"` if [ ! -z "${ps_list}" ]; then echo "${ps_list}" | awk '{print "kill " $1 " 2>/dev/null"}' | sh fi return $? } # kill conflict process # return 0(success)οΌ1(failed) kill_conflict_process() { kill_process "sangfor_vm_proxyd" kill_process "sangfor_vm_proxyd_r" kill_process "sangfor_vm_proxyd_w" return 0 } # trap INT and TERM signalοΌkill child process when exit. trap "kill_process sangfor_vm_proxyd_w; kill_process sangfor_vm_proxyd_r; log 'recv exit INT signal'; exit 1" INT trap "kill_process sangfor_vm_proxyd_w; kill_process sangfor_vm_proxyd_r; log 'recv exit TERM signal'; exit 1" TERM # check send file: if it's timeout ,delete it function check_send_file() { local filepath="" local file_time="" local diff_time="" local now_time="" # ls order by time echo "`ls -rt "${SEND_DIR__}"`" | while read file do [ -z "$file" ] && break now_time=$(date +%s) filepath="${SEND_DIR__}/${file}" file_time=$(stat -c %Y $filepath) diff_time=$((now_time - file_time)) if [ $diff_time -ge 600 ];then log "${filepath} timeout change time is ${file_time}, be deleted." rm $filepath -rf fi done } # main function main() { kill_conflict_process watchdog_reg_proccess "sangfor_vm_proxyd" while true do local write_is_alive=0 local read_is_alive=0 if [ ${g_has_open_serial} -eq 0 ]; then # check vport file if [ ! -e "${g_vportfile}" ]; then log "${g_vportfile} does not exist" sleep 30 continue fi # open serial port failed. exec 99<>"${g_vportfile}" if [ $? -ne 0 ]; then log "open ${g_vportfile} error" # This could be occupied, so kill again kill_conflict_process sleep 10 continue fi g_has_open_serial=1 fi # Judge whether the process exists test ${g_write_pid} -gt 0 && test -d "/proc/${g_write_pid}" && write_is_alive=1 test ${g_read_pid} -gt 0 && test -d "/proc/${g_read_pid}" && read_is_alive=1 if [ ${write_is_alive} -ne 1 ]; then test ${g_write_pid} -ne 0 && log "write process ${g_write_pid} is dead, restart it!" kill_process "sangfor_vm_proxyd_w" "${g_shell_dir}/sangfor_vm_proxyd_w" & g_write_pid=$! log "start write process ${g_write_pid}" fi if [ ${read_is_alive} -ne 1 ]; then test ${g_read_pid} -ne 0 && log "read process ${g_read_pid} is dead, restart it!" kill_process "sangfor_vm_proxyd_r" "${g_shell_dir}/sangfor_vm_proxyd_r" & g_read_pid=$! log "start read process ${g_read_pid}" fi watchdog_check_once sleep 1 done return 0 } main exit $?
Upload File
Create Folder