D
D
Denis2021-02-03 13:50:53
Apache HTTP Server
Denis, 2021-02-03 13:50:53

Kill processes by cron that hang in httpd for more than 60 seconds?

Hello, I need to kill processes that hang for more than 60 seconds in httpd
there is a script, but it only kills that hang for more than an hour

#!/bin/bash
PIDS="`ps eaxo etime,pid,comm | egrep "httpd" | grep -v "00:" | awk '{print $2}'`"
echo "httpd processes running more than one hour..."
for i in ${PIDS}; do { echo "Killing $i"; kill -9 $i; }; done;

The question is how to make to kill processes that are dependent for more than 60 seconds?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question