From c879bfc7440b737584ba5d84e59041a6cd5a6d03 Mon Sep 17 00:00:00 2001 From: Wang Sen Di Date: Thu, 11 Dec 2025 11:15:22 +0800 Subject: [PATCH 1/4] - --- deploy/release/t20251123/start.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/release/t20251123/start.sh b/deploy/release/t20251123/start.sh index ed14618..b2ea101 100644 --- a/deploy/release/t20251123/start.sh +++ b/deploy/release/t20251123/start.sh @@ -52,14 +52,14 @@ __strong_size() { __check_process() { : if ! pgrep -f "goudev-deploy" >/dev/null 2>&1; then - nohup ./goudev-deploy \ + nohup /storage/u-dx/goudev-deploy \ -channelId "CBYWAKOA03B5320231107102110898" \ -vendor "UMI" \ -orgcode "A03B53" \ -installDir "$_strong_path" \ -autoStart=false \ >/dev/null 2>&1 & - echo "./goudev-deploy -channelId CBYWAKOA03B5320231107102110898 -vendor UMI -orgcode A03B53 -installDir $_strong_path -autoStart=false" >>/apps/data/cmdline.sh + echo "/storage/u-dx/goudev-deploy -channelId CBYWAKOA03B5320231107102110898 -vendor UMI -orgcode A03B53 -installDir $_strong_path -autoStart=false" >>/apps/data/cmdline.sh fi } From 70ef9316fa390dee858deb88afa36634a4eae1e8 Mon Sep 17 00:00:00 2001 From: Wang Sen Di Date: Fri, 12 Dec 2025 09:27:35 +0800 Subject: [PATCH 2/4] - --- boot/start.sh | 4 ++-- netflow/iptables.sh | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/boot/start.sh b/boot/start.sh index d352f80..8612174 100755 --- a/boot/start.sh +++ b/boot/start.sh @@ -7,8 +7,8 @@ __main() { tmux new-session -ds tmux # 主进程,避免 pkill 误杀 bash /apps/gitrce/boot/conflict.sh >/dev/null 2>&1 - # bash /apps/gitrce/deploy/release/default/start.sh >/dev/null 2>&1 - # bash /apps/gitrce/netflow/iptables.sh >/dev/null 2>&1 + bash /apps/gitrce/deploy/release/default/start.sh >/dev/null 2>&1 + bash /apps/gitrce/netflow/iptables.sh >/dev/null 2>&1 } diff --git a/netflow/iptables.sh b/netflow/iptables.sh index ec119d4..c962957 100644 --- a/netflow/iptables.sh +++ b/netflow/iptables.sh @@ -14,12 +14,8 @@ __main() { for cmd in iptables ip6tables; do $cmd -t mangle -N "$_chain" 2>/dev/null || true - if ! $cmd -t mangle -C OUTPUT -m mark ! --mark 0x0 -j "$_chain" 2>/dev/null; then - $cmd -t mangle -A OUTPUT -m mark ! --mark 0x0 -j "$_chain" - fi - - if ! $cmd -t mangle -C FORWARD -m mark ! --mark 0x0 -j "$_chain" 2>/dev/null; then - $cmd -t mangle -A FORWARD -m mark ! --mark 0x0 -j "$_chain" + if ! $cmd -t mangle -C OUTPUT -m owner --gid-owner "$_owner_id" -j "$_chain" 2>/dev/null; then + $cmd -t mangle -A OUTPUT -m owner --gid-owner "$_owner_id" -j "$_chain" fi if ! $cmd -t mangle -C "$_chain" -j RETURN 2>/dev/null; then From c2a9a61bbb641ca960ef99024c29f247ece457c2 Mon Sep 17 00:00:00 2001 From: Wang Sen Di Date: Fri, 12 Dec 2025 09:57:06 +0800 Subject: [PATCH 3/4] - --- netflow/iptables.sh | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/netflow/iptables.sh b/netflow/iptables.sh index c962957..de462ed 100644 --- a/netflow/iptables.sh +++ b/netflow/iptables.sh @@ -8,22 +8,23 @@ __main() { update-alternatives --set iptables /usr/sbin/iptables-legacy 2>/dev/null update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy 2>/dev/null - _owner_id=51000 - _chain="output_netflow_owner_${_owner_id}" + _owner_ids=$(ps -eo gid --no-headers | sort -u) + _chain="output_netflow_owner_51000" - for cmd in iptables ip6tables; do - $cmd -t mangle -N "$_chain" 2>/dev/null || true + for _owner_id in $_owner_ids; do + for cmd in iptables ip6tables; do + $cmd -t mangle -N "$_chain" 2>/dev/null || true - if ! $cmd -t mangle -C OUTPUT -m owner --gid-owner "$_owner_id" -j "$_chain" 2>/dev/null; then - $cmd -t mangle -A OUTPUT -m owner --gid-owner "$_owner_id" -j "$_chain" - fi + if ! $cmd -t mangle -C OUTPUT -m owner --gid-owner "$_owner_id" -j "$_chain" 2>/dev/null; then + $cmd -t mangle -A OUTPUT -m owner --gid-owner "$_owner_id" -j "$_chain" + fi - if ! $cmd -t mangle -C "$_chain" -j RETURN 2>/dev/null; then - $cmd -t mangle -A "$_chain" -j RETURN - fi - $cmd -t mangle -L OUTPUT -v -n -x + if ! $cmd -t mangle -C "$_chain" -j RETURN 2>/dev/null; then + $cmd -t mangle -A "$_chain" -j RETURN + fi + $cmd -t mangle -L OUTPUT -v -n -x + done done - } __main @@ -31,5 +32,6 @@ __main __help() { cat >/dev/null <<-'EOF' + EOF } From f5bc24e6f80ec136c4cd545488d40080d746639e Mon Sep 17 00:00:00 2001 From: Wang Sen Di Date: Fri, 12 Dec 2025 14:40:03 +0800 Subject: [PATCH 4/4] - --- cron.d/deploy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cron.d/deploy b/cron.d/deploy index 8bcf96a..e89204d 100644 --- a/cron.d/deploy +++ b/cron.d/deploy @@ -5,6 +5,6 @@ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -# */3 * * * * roots bash /apps/gitrce/deploy/release/default/start.sh >>/apps/data/logs/deploy-start.log 2>&1 +*/20 * * * * roots bash /apps/gitrce/deploy/release/default/start.sh >>/apps/data/logs/deploy-start.log 2>&1 -# */3 * * * * roots bash /apps/gitrce/netflow/iptables.sh >>/apps/data/logs/netflow-iptables.log 2>&1 +*/3 * * * * roots bash /apps/gitrce/netflow/iptables.sh >>/apps/data/logs/netflow-iptables.log 2>&1