mirror of
https://github.com/openappsec/openappsec.git
synced 2025-06-28 16:41:02 +03:00
fix watchdog restarts
This commit is contained in:
parent
59da201d5c
commit
1f80b79bd0
@ -97,13 +97,8 @@ touch /etc/cp/watchdog/wd.startup
|
||||
active_watchdog_pid=$!
|
||||
while true; do
|
||||
if [ -f /tmp/restart_watchdog ]; then
|
||||
echo "restarting the watch dog " >> /etc/cp/conf/wiaam.txt
|
||||
echo "current pid = $current_watchdog_pid" >> /etc/cp/conf/wiaam.txt
|
||||
echo "active pid = $active_watchdog_pid" >> /etc/cp/conf/wiaam.txt
|
||||
echo "killing pid = $(pgrep -f -x -o "/bin/(bash|sh) /etc/cp/watchdog/cp-nano-watchdog")" >> /etc/cp/conf/wiaam.txt
|
||||
|
||||
rm -f /tmp/restart_watchdog
|
||||
kill -9 "$(pgrep -f -x -o "/bin/(bash|sh) /etc/cp/watchdog/cp-nano-watchdog")"
|
||||
kill -9 ${active_watchdog_pid}
|
||||
fi
|
||||
if [ ! "$(ps -f | grep cp-nano-watchdog | grep ${active_watchdog_pid})" ]; then
|
||||
/etc/cp/watchdog/cp-nano-watchdog >/dev/null 2>&1 &
|
||||
|
Loading…
x
Reference in New Issue
Block a user