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.

Logrotate broken?

Discussion in 'General Discussion' started by fizz, Dec 16, 2004.

  1. fizz

    fizz Well-Known Member

    Joined:
    Jan 25, 2002
    Messages:
    202
    Likes Received:
    0
    Trophy Points:
    16
    /etc/cron.daily/logrotate:

    error: error running postrotate script


    This is what im getting in my cron daily emails from cpanel, any clue what might be wronge? If i try running manually from command line, there are no errors.

    Maybe my logrotate.conf is screwed up?
    below is my logrotate.conf
    Code:
    # see "man logrotate" for details
    # rotate log files weekly
    weekly
    
    # keep 4 weeks worth of backlogs
    rotate 4
    
    # create new (empty) log files after rotating old ones
    create
    
    # uncomment this if you want your log files compressed
    #compress
    
    # RPM packages drop log rotation information into this directory
    include /etc/logrotate.d
    
    # no packages own wtmp -- we'll rotate them here
    /var/log/wtmp {
        monthly
        create 0664 root utmp
        rotate 1
    }
    
    # system-specific logs may be also be configured here.
    /var/log/exim_mainlog {
        daily
        create 0640 mailnull mail
        compress
        postrotate
        /usr/bin/killall -HUP exim
        endscript
    }
    
    
    I added exim to daily log rotate because i get alot of email and have scripts analyse this which grep kills CPU if you dont do this every day.
     
  2. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    I would try HUP without the hyphen.
     
  3. dwh2

    dwh2 Well-Known Member

    Joined:
    Jan 14, 2004
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    My log is not rotating daily as it is supposed to. How can I debug it ?

    Did you have any luck with your problem? My logrotate.conf file says the same as yours.
     
  4. hostmedic

    hostmedic Well-Known Member

    Joined:
    Apr 30, 2003
    Messages:
    559
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Washington Court House, Ohio, United States
    cPanel Access Level:
    DataCenter Provider
    same thing here

    also getting the same thing here - only on 1 server however...
    strange
     
  5. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    What errors do you get from:

    /usr/sbin/logrotate -vf /etc/logrotate.conf

    If that actually sails through OK, are you running FC2?
     
  6. hostmedic

    hostmedic Well-Known Member

    Joined:
    Apr 30, 2003
    Messages:
    559
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Washington Court House, Ohio, United States
    cPanel Access Level:
    DataCenter Provider
    Fc2

    Yup - this box is FC2

    It appears to be a common issue ~ tmp not wanting to run noexec :(

    as found searching in a few other forums...

    thanks chirpy - as always i can depend upon you in the forums...
     
  7. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Indeed, and the Fedora developers wouldn't fix the bug even before FC2 was EOL.

    You get easily resolve it, though, by editing /etc/cron.daily/logrotate and add line after the first line:

    export TMPDIR=/tmp_logrotate

    Then:

    mkdir /tmp_logrotate
     
Loading...

Share This Page