fix debug script
This commit is contained in:
@@ -5,8 +5,7 @@ if [ "$1" == "-h" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
PORT="${2:-3222}"
|
PORT="${2:-3222}"
|
||||||
PLUGIN_NAME="${1:-'zabbix-plugin_'}"
|
PLUGIN_NAME="${1:-zabbix-plugin_}"
|
||||||
echo $PORT $PLUGIN_NAME
|
|
||||||
|
|
||||||
ptrace_scope=`cat /proc/sys/kernel/yama/ptrace_scope`
|
ptrace_scope=`cat /proc/sys/kernel/yama/ptrace_scope`
|
||||||
if [ "$ptrace_scope" != 0 ]; then
|
if [ "$ptrace_scope" != 0 ]; then
|
||||||
@@ -14,5 +13,6 @@ if [ "$ptrace_scope" != 0 ]; then
|
|||||||
Read more at https://www.kernel.org/doc/Documentation/security/Yama.txt"
|
Read more at https://www.kernel.org/doc/Documentation/security/Yama.txt"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dlv attach `pgrep ${PLUGIN_NAME}` --headless --listen 0.0.0.0:${PORT} --api-version 2
|
PLUGIN_PID=`pgrep ${PLUGIN_NAME}`
|
||||||
|
dlv attach ${PLUGIN_PID} --headless --listen 0.0.0.0:${PORT} --api-version 2
|
||||||
pkill dlv
|
pkill dlv
|
||||||
|
|||||||
Reference in New Issue
Block a user