简而言之:
为什么Apache重新启动或重新加载configuration本身?
长版
在我的debian lenny稳定的服务器上,它有一个相当默认的设置(apache2,mod_php,mysql客户端,apc,…)我改变了我的apc.ini,我不确定它是否有缺陷,因为它是一个生产服务器,我只是在不重新启动Web服务器的情况下安全的文件。
今天@ cron.daily时间(6:25),服务器重新启动自己,并由于apc.ini故障停留下来。 我真的想知道,为什么服务器重新启动自己。 也为什么今天? 这是cron.daily时间,而不是每周的时间,错误的configuration在线从星期二开始。
crontab中:
# mh dom mon dow user command 17 * * * * root cd / && run-parts --report /etc/cron.hourly 25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) 47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
cron.daily内容:
apache2 apt aptitude bsdmainutils logrotate man-db standard
cron.weekly内容:
man-db
有任何想法吗?
编辑:添加基于所选答案的logrotate标签
cron运行logrotate,logrotate重新加载Apache:
/var/log/apache2/*.log { ........ postrotate if [ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then /etc/init.d/apache2 reload > /dev/null fi endscript }
也许我错了我不知道,但我认为,当Apache Web服务器崩溃init.d自动重新启动,也取决于环境和Apache的configuration(例如什么操作系统或Linux发行版使用)