Shadow-Here


Server : Apache
System : Linux methusalix2 3.16.0-11-amd64 #1 SMP Debian 3.16.84-1 (2020-06-09) x86_64
User : hios ( 1437)
PHP Version : 5.6.40-0+deb8u12
Disable Function : proc_close,proc_open,dl,shell_exec,passthru
Directory :  /usr/local/bin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :
Current File : //usr/local/bin/apx-apachelogcheck
#!/bin/bash


a=`/usr/sbin/logtail /var/log/apache2/error.log | /bin/grep "Error Cannot kill process"`
if [ "x" != "x$a" ]; then
        echo "apache has problems Error Cannot kill process"
        logger "apache has problems"
        /usr/bin/killall -9 apache2 ; /bin/sleep 1 ; /usr/bin/killall -9 apache2 ; /usr/sbin/service apache2 restart
fi

a=`/usr/sbin/logtail -f /var/log/apache2/error.log -o /var/log/apache2/error.log.offset2 | /bin/grep "child died with signal"`
if [ "x" != "x$a" ]; then
        echo "apache has problems child died with signal"
        logger "apache has problems"
        /usr/bin/killall -9 apache2 ; /bin/sleep 1 ; /usr/bin/killall -9 apache2 ; /usr/sbin/service apache2 restart
fi

Samx