Merhabalar,
Bugün 1numarahost dan yavuz bey le konuşurken 1 script önerdi. yazılana göre httpd düşünce kendini otomatik restart ediyor ama hangi mantıkla çalıştığını ben çözemedim kodlardan, yorumlarınızı bekliyorum.
nano /usr/local/httpdrestart.sh
Alıntı
#!/bin/bash # Apache Process Monitor # Restart Apache Web Server When It Goes Down
# ------------------------------------------------------------------------- # Copyright (c) 2003 nixCraft project <http://cyberciti.biz/fb/> # This script is licensed under GNU GPL version 2.0 or above
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
# Visit Bash Shell Scripting Directory For Linux / UNIX for more information.
# ------------------------------------------------------------------------- # RHEL / CentOS / Fedora Linux restart command
RESTART="service httpd restart"
# uncomment if you are using Debian / Ubuntu Linux
#RESTART="/etc/init.d/apache2 restart"
#path to pgrep command
PGREP="/usr/bin/pgrep" # find httpd pid $PGREP httpd
if [ $? -ne 0 ] #instead of -eq
then
# restart apache
$RESTART
fi
Kaydet çık.
Crontab a ekle :
Alıntı
*/5 * * * * /usr/local/httpdrestart.sh >/dev/null 2>&1