./categories/os
pgrep로 httpd 수 감시·재시작
httpd 프로세스 수가 임계치 이상이면 Apache 재시작.
if [ "`pgrep -x httpd | wc -l`" -ge "500" ]; then
/usr/local/apache/bin/apachectl restart
fi
pgrep -x httpd # 정확한 프로세스명 매칭
pgrep -c httpd # 개수만
관련 링크: https://app.notion.com/p/03861aea4b004e258d7d124a0d596882
./comments