Skip to content

Commit

Permalink
add ub_trace.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
kkkgo committed May 18, 2024
1 parent a08242c commit 75c7659
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker-latest-schedule.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Schedule Latest Build Docker

on:
schedule:
- cron: '57 15 * * 4'
# schedule:
# - cron: '57 15 * * 4'
workflow_dispatch:
jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ RUN apk add --no-cache ca-certificates dcron tzdata hiredis libevent dnscrypt-pr
mv /usr/sbin/named.cache /etc/unbound/named.cache && \
adduser -D -H unbound &&\
mv /usr/sbin/repositories /etc/apk/repositories
ARG DEVLOG_SW
# ARG DEVLOG_SW
ENV TZ=Asia/Shanghai \
# DEVLOG=$DEVLOG_SW \
UPDATE=weekly \
Expand Down
1 change: 1 addition & 0 deletions src/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ bt=$(date +"%Y-%m-%d %H:%M:%S %Z")
sed -i "s/{bulidtime}/$bt/g" /src/init.sh
sed -i "s/{bulidtime}/$bt/g" /src/debug.sh
sed -i "s/{bulidtime}/$bt/g" /src/test.sh
sed -i "s/{bulidtime}/$bt/g" /src/ub_trace.sh

#clean
chmod +x /src/*.sh
Expand Down
4 changes: 2 additions & 2 deletions src/debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,14 @@ else
echo kill unbound and reload to debug mode...
unbound_id=$(ps | grep -v "grep" | grep "unbound_raw" | grep -Eo "[0-9]+" | head -1)
kill "$unbound_id"
sed -i "s/verbosity: 0/verbosity: 2/g" /tmp/unbound_raw.conf
sed -i "s/verbosity:.*/verbosity: 2/g" /tmp/unbound_raw.conf
unbound -c /tmp/unbound_raw.conf -p -d &
# fi
dig www.jd.com @127.0.0.1 -p5301
dig www.taobao.com @127.0.0.1 -p5301
unbound_id=$(ps | grep -v "grep" | grep "unbound_raw" | grep -Eo "[0-9]+" | head -1)
kill "$unbound_id"
sed -i "s/verbosity: 2/verbosity: 0/g" /tmp/unbound_raw.conf
sed -i "s/verbosity:.*/verbosity: 0/g" /tmp/unbound_raw.conf
unbound -c /tmp/unbound_raw.conf -p
blank
fi
Expand Down
20 changes: 20 additions & 0 deletions src/ub_trace.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh
echo images build time : {bulidtime}
echo "-> test start \`$(date +%s)\`"
echo "\`\`\`rust"
echo "[TEST]Run unbound trace test..."
echo kill unbound and reload to debug mode...
unbound_id=$(ps | grep -v "grep" | grep "unbound_raw" | grep -Eo "[0-9]+" | head -1)
kill "$unbound_id"
sed -i "s/verbosity:.*/verbosity: 5/g" /tmp/unbound_raw.conf
unbound -c /tmp/unbound_raw.conf -p -d -v &
dig www.jd.com @127.0.0.1 -p5301
dig www.taobao.com @127.0.0.1 -p5301
echo unbound trace finish.
echo "\`\`\`"
echo "-> test end \`$(date +%s)\`"
echo
unbound_id=$(ps | grep -v "grep" | grep "unbound_raw" | grep -Eo "[0-9]+" | head -1)
kill "$unbound_id"
sed -i "s/verbosity:.*/verbosity: 0/g" /tmp/unbound_raw.conf
unbound -c /tmp/unbound_raw.conf -p
3 changes: 1 addition & 2 deletions src/unbound.conf
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,7 @@ server:
# 0: fetch on demand,
# positive value: fetch that many targets opportunistically.
# Enclose the list of numbers between quotes ("").
# target-fetch-policy: "3 2 1 0 0"
#lowrmem target-fetch-policy: "2 1 0 0 0 0"
target-fetch-policy: "0 0 0 0 0"

# Harden against very small EDNS buffer sizes.
# harden-short-bufsize: yes
Expand Down

0 comments on commit 75c7659

Please sign in to comment.