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_heartalive.sh
#! /bin/bash shell_dir=$( cd "$( dirname "${BASH_SOURCE[0]}")" && pwd) . "${shell_dir}/update_config" . "${shell_dir}/log.sh" . "${shell_dir}/update_common_func" declare -r g_change_conf_file_name="vtp-sangfor-vmstools-install" declare -r g_sleep_time=20 x86_or_x64(){ local x64="x86_64" local info="" info="`uname -a 2>/dev/null`" if [ x"${info/${x64}/}" = x"${info}" ];then #x86 return 32 else return 64 fi } init(){ local code=0 g_current_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) x86_or_x64 code=$? if [ ${code} -eq 32 ];then g_change_conf_file_path="${g_current_dir}/x86/${g_change_conf_file_name}" else g_change_conf_file_path="${g_current_dir}/x64/${g_change_conf_file_name}" fi } notify_heart_alive_to_host(){ local op_notify="vmheart" if [ ! -e "${g_change_conf_file_path}" ];then echo "${g_change_conf_file_path} is not exist!" return 1 fi chmod +x "${g_change_conf_file_path}" >/dev/null 2>&1 while true do "${g_change_conf_file_path}" ${op_notify} sleep $g_sleep_time done return 0 } main() { init notify_heart_alive_to_host } #lock exec add by wtd@20161025 lockEntry() { if ! which flock >/dev/null 2>&1; then #if no which or no flock, use ps style echo "[ps] flock is not found" # 1, 0(ps not found) or empty(wc not found) or anything other invalid, can run # 2 is not running, can run # > 2 has already running, can't run local count=$(ps aux 2>/dev/null | grep sangfor_heartalive | grep -v grep | wc -l 2>/dev/null) if [ "" != "$count" -a $count -gt 2 ]; then echo "[ps] has same process already running" return 1 fi echo "[ps] found count $count, can run" main else echo "[flock] flock found" local lock="" if [ -d "/tmp" ]; then lock="/tmp" fi lock="$lock/heartalive.lock" touch ${lock} 2>/dev/null # prevent switch to a low privilege user, lack privilege chmod a+r ${lock} 2>/dev/null ( if ! flock -n -x 200; then echo "[flock] flock $lock failed $?" return 1 fi echo "[flock] flock $lock success" main ) 200<${lock} fi return 0 } lockEntry
Upload File
Create Folder