add help scripts

This commit is contained in:
Joe Dong
2023-09-25 14:10:28 +08:00
parent 8c1f359040
commit 1856a36648
2 changed files with 16 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
executable_filename="component_container"
while true; do
pids=$(pgrep -f "${executable_filename}")
if [ -z "$pids" ]; then
echo "The process ${executable_filename} is not running."
else
for pid in $pids; do
fd_count=$(lsof -p "${pid}" 2>/dev/null | wc -l)
echo "File descriptor count for process ${executable_filename} (${pid}): ${fd_count}"
done
fi
sleep 1
done