apache 自动重新启动/重新加载配置,为什么?

c33*_*33s 9 debian logrotate cron apache-2.2

简而言之:

  • 运行生产网络服务器
  • 星期二:更改了配置(更改是错误的,语法错误)但故意不重新启动 apache
  • 今天 apache 自己重新启动或重新加载配置@cron.daily time
  • 阿帕奇停机了

为什么 apache 自己重新启动或重新加载配置?

长版

在我的 debian lenny 稳定服务器上,它有一个非常默认的设置(apache2、mod_php、mysql 客户端、apc,...)我对我的 apc.ini 进行了更改,我不确定它是否有问题,因为它是一个生产服务器,我只是在没有重新启动网络服务器的情况下保护了文件。

今天@cron.daily时间(6:25),由于apc.ini错误,服务器自行重启并保持停机。我真的很想知道,为什么服务器会自行重启。还有为什么是今天?这是 cron.daily 时间而不是每周时间,错误的配置从星期二开始就在线。

定时任务:

# m h 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 )
Run Code Online (Sandbox Code Playgroud)

cron.daily 内容:

apache2
apt
aptitude
bsdmainutils
logrotate
man-db
standard
Run Code Online (Sandbox Code Playgroud)

cron.weekly 内容:

man-db
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

编辑:根据所选答案添加 logrotate 标签

oos*_*hro 7

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
}
Run Code Online (Sandbox Code Playgroud)