The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

susexec logfile grows and grows

Discussion in 'General Discussion' started by stuartmcdonald, Dec 10, 2007.

  1. stuartmcdonald

    Joined:
    Jun 22, 2005
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    My susexec logfile is getting pretty big (800meg+) logging every PHP script the server runs -- is that normal? Should it automatically rotating off, or is that something that needs to be setup?

    Tks in advance
     
  2. darren.nolan

    darren.nolan Well-Known Member

    Joined:
    Oct 4, 2007
    Messages:
    259
    Likes Received:
    0
    Trophy Points:
    16
    800mb depending on how many customers you are server, is probably fine. I don't believe suexec rotates, but suphp does (is that right cPanel? I recall a post saying that later builds of cPanel would automatically rotate suphp's log as intended).

    As suexec is becoming older, I believe you may want to rotate that file yourself.
     
  3. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    cpanellogd will rotate these logs:

    Code:
    /usr/local/apache/logs/suexec_log
          /usr/local/apache/logs/ssl_engine_log
          /usr/local/apache/logs/access_log
          /usr/local/apache/logs/error_log
          /usr/local/apache/logs/mod_jk.log
          /usr/local/apache/logs/referer_log
          /usr/local/apache/logs/agent_log
          /usr/local/apache/logs/ssl_log
          /usr/local/apache/logs/suphp_log
          /etc/httpd/logs/error_log
    
     
  4. darren.nolan

    darren.nolan Well-Known Member

    Joined:
    Oct 4, 2007
    Messages:
    259
    Likes Received:
    0
    Trophy Points:
    16
  5. stuartmcdonald

    Joined:
    Jun 22, 2005
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Ok, thanks for the assistance.
     
  6. sehh

    sehh Well-Known Member

    Joined:
    Feb 11, 2006
    Messages:
    579
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Europe
    Its not rotated here, i opened a bug report in bugzilla many months ago.

    I added my own lines in logrotate and had it rotated by myself in the end.
     
  7. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Note that the log rotation functionalities were improved a few weeks ago in EDGE. If you are running STABLE, it is likely these changes have not yet propagated to your build.
     
  8. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    The logs were added somewhat recently. If you were running the non-EA3 Stable (or still are), then cpanellogd will not rotate them.
     
  9. ChrisHardie

    ChrisHardie Registered

    Joined:
    May 14, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Manual workaround for now

    We had this same issue with the suexec_log and with access_log and error_log under WHM 11.11.0 cPanel 11.15.0-R17665, causing our /usr partition to fill up faster than it should. As a manual workaround until cpanel starts doing the rotating for us, we run this script every night from cron:

    Code:
    #!/bin/sh
    #
    # cPanel doesn't rotate these at all or as quickly as it should.  This is a temporary solution.
    
    access_log=access_log
    error_log=error_log
    suexec_log=suexec_log
    
    src_dir=/usr/local/apache/logs
    dest_dir=/home/backups/rotated-logs
    
    # Rotate access log
    cat $dest_dir/$access_log.2 > $dest_dir/$access_log.3
    cat $dest_dir/$access_log.1 > $dest_dir/$access_log.2
    cat $dest_dir/$access_log.0 > $dest_dir/$access_log.1
    cat $src_dir/$access_log > $dest_dir/$access_log.0
    cat < /dev/null > $src_dir/$access_log
    
    # Rotate error log
    cat $dest_dir/$error_log.2 > $dest_dir/$error_log.3
    cat $dest_dir/$error_log.1 > $dest_dir/$error_log.2
    cat $dest_dir/$error_log.0 > $dest_dir/$error_log.1
    cat $src_dir/$error_log > $dest_dir/$error_log.0
    cat < /dev/null > $src_dir/$error_log
    
    # Rotate suexec log
    cat $dest_dir/$suexec_log.2 > $dest_dir/$suexec_log.3
    cat $dest_dir/$suexec_log.1 > $dest_dir/$suexec_log.2
    cat $dest_dir/$suexec_log.0 > $dest_dir/$suexec_log.1
    cat $src_dir/$suexec_log > $dest_dir/$suexec_log.0
    cat < /dev/null > $src_dir/$suexec_log
    
    # done.
    I know there are ways to do this via newsyslog, but I didn't want to mess with the cpanel magic and the possibility of having to restart a process that wasn't expecting to be restarted by newsyslog, etc.

    Use at your own risk - I make no warranties - and make sure you tweak the "dest_dir" variable if you do use it. I hope that's helpful.

    Chris
     
  10. manokiss

    manokiss Well-Known Member

    Joined:
    Mar 31, 2002
    Messages:
    571
    Likes Received:
    0
    Trophy Points:
    16
    Hi Dave,

    Wondering if this was fixed already on:

    WHM 11.23.2 cPanel 11.23.3-R25623

    I see many of those logs are not rotating, for example i have:

    -rw-r--r-- 1 root root 260731125 Jul 2 15:44 error_log

    It has been configured to rotate after xxMb in the files size or something?

    Thanx!
     
  11. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    I made that post in 2007. So yes, those changes have been propagated by now :).

    I recommend you have our technical analysts take a look at your server to determine the cause of this behavior: http://tickets.cpanel.net/submit
     
Loading...
Similar Threads - susexec logfile grows
  1. inalto
    Replies:
    1
    Views:
    200

Share This Page