Created
October 16, 2022 11:57
-
-
Save justdoit0823/04dfc7751f0e66633bc133db7e56c0de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function show_haproxy_socket_info(){ | |
ret=$(ss -tnlp|grep haproxy) | |
echo $ret | |
pstr=$(echo $ret | awk -F'\t' '{split($NF, a, ","); split(a[2], b, "="); split(a[3], c, "="); split(c[2], d, ")"); print b[2], d[1]}') | |
IFS=' ' | |
read -r -a array <<< "$pstr" | |
pid="${array[0]}" | |
fd="${array[1]}" | |
stat /proc/$pid/fd/$fd | |
#lsof -p $pid |grep -v REG|grep -v DIR|grep -v ESTABLISHED | |
#lsof -p 3529 |grep -v REG|grep -v DIR|grep -v ESTABLISHED | |
#stat /proc/3529/fd/5 | |
} | |
show_haproxy_socket_info | |
service haproxy reload & | |
#show_haproxy_socket_info | |
#show_haproxy_socket_info | |
#show_haproxy_socket_info | |
#show_haproxy_socket_info | |
#show_haproxy_socket_info | |
ss -tnlep|grep haproxy | |
#ps aux|grep haproxy|awk '{pid=pid","$2} END {print pid}'|xargs lsof -p|grep LISTEN | |
ss -tnlep|grep haproxy | |
#ps aux|grep haproxy|awk '{pid=pid","$2} END {print pid}'|xargs lsof -p|grep LISTEN | |
ss -tnlep|grep haproxy | |
#ps aux|grep haproxy|awk '{pid=pid","$2} END {print pid}'|xargs lsof -p|grep LISTEN | |
ss -tnlep|grep haproxy | |
#ps aux|grep haproxy|awk '{pid=pid","$2} END {print pid}'|xargs lsof -p|grep LISTEN | |
ss -tnlep|grep haproxy | |
#ps aux|grep haproxy|awk '{pid=pid","$2} END {print pid}'|xargs lsof -p|grep LISTEN | |
show_haproxy_socket_info |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment