Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
lusin
V2EX  ›  Linux

请教个LINUX日志问题

  •  
  •   lusin · Mar 31, 2013 · 3713 views
    This topic created in 4817 days ago, the information mentioned may be changed or developed.
    请问在httpd.conf中设置了日志生成文件:/var/log/httpd/access_log

    logrotate中设置了 每天生成一次日志文件

    第一天日志内容写入到 access_log
    第二天日志文件为 access_log access_log-20130331

    但是日志内容写入到 access_log-20130331中而不是 access_log,这是为什么呢?
    4 replies    1970-01-01 08:00:00 +08:00
    gamexg
        1
    gamexg  
       Mar 31, 2013
    向主进程发送USR1信号
    lusin
        2
    lusin  
    OP
       Apr 1, 2013
    什么原理呢?

    你们没遇到过这种情况吗?
    BOYPT
        3
    BOYPT  
       Apr 1, 2013
    @lusin 检查/etc/logrotate.d/apache 文件,里面反转了文件后会执行postrotate语句中的命令,一般是发送信号使进程重新打开log文件。

    lz的情况估计是信号发送的语句没起作用。
    lusin
        4
    lusin  
    OP
       Apr 1, 2013
    谢谢两位
    可能是没有重启syslog的原因
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   985 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 22:27 · PVG 06:27 · LAX 15:27 · JFK 18:27
    ♥ Do have faith in what you're doing.