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.

error running postrotate script

Discussion in 'General Discussion' started by xTerminus, Jul 2, 2006.

  1. xTerminus

    xTerminus Registered

    Joined:
    Jun 4, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Does anyone know how I can fix this:

    /etc/cron.daily/logrotate:

    error: error running postrotate script
    error: error running postrotate script
    error: error running postrotate script
    error: error running postrotate script
    error: error running postrotate script
    error: error running shared postrotate script for /var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron

    Or should it just be ignored? I get the error about once a week, havn't timed it exactly. I have already searched the forums & tried the suggestions regarding this matter but none so far have worked.
     
  2. iquest

    iquest Active Member

    Joined:
    Mar 16, 2004
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    mkdir /mytmp

    # then edit logrotate

    pico -w /etc/cron.daily/logrotate

    # set the TMPDIR so your configuration looks like this:


    #!/bin/sh
    TMPDIR=/mytmp
    export TMPDIR
    /usr/sbin/logrotate /etc/logrotate.conf
    EXITVALUE=$?
    if [ $EXITVALUE != 0 ]; then
    /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
    fi
    exit 0


    # then run /etc/cron.daily/logrotate and see if it works.


    # or you can run interactive test by running the following command:


    export TMPDIR=/mytmp

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

    xTerminus Registered

    Joined:
    Jun 4, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    When I run /etc/cron.daily/logrotate both before & after editing the file, it doesn't seem to do anything, so I don't know if it's working or not. I checked in the mytmp folder & it is empty. I guess I will find out after a few weeks if I receive no more error reports.

    Thanks
     
  4. iquest

    iquest Active Member

    Joined:
    Mar 16, 2004
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1

    # you won't see anything different within 1/2 days - unless you run the following
    # commands to run an interactive test - after you edit the "logrotate.conf" file:

    export TMPDIR=/mytmp
    /usr/sbin/logrotate -vf /etc/logrotate.conf
     
  5. ArgonX

    ArgonX Registered

    Joined:
    Nov 1, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    hmm

    i had same problem so i run and edit at u recommend .. then i run this command in last post and got this:

    this is just part:
    Handling 22 logs

    rotating pattern: /var/log/acpid forced from command line (4 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/acpid
    log needs rotating
    rotating log /var/log/acpid, log->rotateCount is 4
    renaming /var/log/acpid.4 to /var/log/acpid.5 (rotatecount 4, logstart 1, i 4),
    old log /var/log/acpid.4 does not exist
    renaming /var/log/acpid.3 to /var/log/acpid.4 (rotatecount 4, logstart 1, i 3),
    old log /var/log/acpid.3 does not exist
    renaming /var/log/acpid.2 to /var/log/acpid.3 (rotatecount 4, logstart 1, i 2),
    old log /var/log/acpid.2 does not exist
    renaming /var/log/acpid.1 to /var/log/acpid.2 (rotatecount 4, logstart 1, i 1),
    old log /var/log/acpid.1 does not exist
    renaming /var/log/acpid.0 to /var/log/acpid.1 (rotatecount 4, logstart 1, i 0),
    old log /var/log/acpid.0 does not exist
    log /var/log/acpid.5 doesn't exist -- won't try to dispose of it
    renaming /var/log/acpid to /var/log/acpid.1
    creating new log mode = 0640 uid = 0 gid = 0
    running postrotate script

    rotating pattern: /var/log/apfados_log /var/log/apf_log forced from command line (4 rotations)
    empty log files are rotated, old logs are removed
    considering log /var/log/apfados_log
    log /var/log/apfados_log does not exist -- skipping
    considering log /var/log/apf_log
    log needs rotating
    rotating log /var/log/apf_log, log->rotateCount is 4
    renaming /var/log/apf_log.4 to /var/log/apf_log.5 (rotatecount 4, logstart 1, i 4),


    is it good or bad ?
     
  6. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    That output is fine from logrotate - the errors simply relate to log files that don't exists on your server.
     
  7. hgrfoshee

    hgrfoshee Member
    PartnerNOC

    Joined:
    Aug 22, 2006
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Having the proper changes (and reading a number of other threads on this), I'm experiencing the same issue with logs not rotating and haven't for the last 6 months. Here's the output of /usr/sbin/logrotate -vf /etc/logrotate.conf:

    Code:
     sudo /usr/sbin/logrotate -vf /etc/logrotate.conf 
    reading config file /etc/logrotate.conf
    including /etc/logrotate.d
    reading config file cups
    reading config info for /var/log/cups/*_log 
    reading config file exim
    reading config info for /var/log/exim_mainlog 
    reading config info for /var/log/exim_paniclog 
    reading config info for /var/log/exim_rejectlog 
    reading config file httpd
    reading config info for /var/log/httpd/*log 
    reading config file mgetty
    reading config info for /var/log/mgetty.log.tty[^.] /var/log/mgetty.log.tty[^.][^.] /var/log/mgetty.log.tty[^.][^.][^.] /var/log/mgetty.log.tty[^.][^.][^.][^.] /var/log/mgetty.log.tty[^.][^.][^.][^.][^.] /var/log/mgetty.log.tty[^.][^.][^.][^.][^.][^.] /var/log/mgetty.log.tty[^.][^.][^.][^.][^.][^.][^.] /var/log/mgetty.log.tty[^.][^.][^.][^.][^.][^.][^.][^.] /var/log/mgetty.log.tty[^.][^.][^.][^.][^.][^.][^.][^.][^.] /var/log/mgetty.log.tty[^.][^.][^.][^.][^.][^.][^.][^.][^.][^.] /var/log/mgetty.log.unknown /var/log/mgetty.callback 
    reading config file mysql
    reading config info for /var/lib/mysql/mysqld.log 
    reading config file named
    reading config info for /var/log/named.log 
    reading config file psacct
    reading config info for /var/account/pacct 
    reading config file redhat-config-network
    reading config info for /var/log/redhat-config-network 
    reading config file rpm
    reading config info for /var/log/rpmpkgs 
    reading config file samba
    reading config info for /var/log/samba/*.log 
    reading config file snmpd
    reading config info for /var/log/snmpd.log 
    reading config file snmpdrpmnew_old
    error: snmpdrpmnew_old:1 duplicate log entry for /var/log/snmpd.log
    And the logs have not rotated since June of 2006 and I've just run this command again:

    Code:
    rfoshee@hosting [~]# date
    Tue Jan  9 19:37:02 EST 2007
    rfoshee@hosting [~]# sudo /usr/sbin/logrotate -vf /etc/logrotate.conf 
    reading config file /etc/logrotate.conf
    including /etc/logrotate.d
    reading config file cups
    reading config info for /var/log/cups/*_log 
    reading config file exim
    reading config info for /var/log/exim_mainlog 
    reading config info for /var/log/exim_paniclog 
    reading config info for /var/log/exim_rejectlog 
    reading config file httpd
    reading config info for /var/log/httpd/*log 
    reading config file mgetty
    reading config info for /var/log/mgetty.log.tty[^.] /var/log/mgetty.log.tty[^.][^.] /var/log/mgetty.log.tty[^.][^.][^.] /var/log/mgetty.log.tty[^.][^.][^.][^.] /var/log/mgetty.log.tty[^.][^.][^.][^.][^.] /var/log/mgetty.log.tty[^.][^.][^.][^.][^.][^.] /var/log/mgetty.log.tty[^.][^.][^.][^.][^.][^.][^.] /var/log/mgetty.log.tty[^.][^.][^.][^.][^.][^.][^.][^.] /var/log/mgetty.log.tty[^.][^.][^.][^.][^.][^.][^.][^.][^.] /var/log/mgetty.log.tty[^.][^.][^.][^.][^.][^.][^.][^.][^.][^.] /var/log/mgetty.log.unknown /var/log/mgetty.callback 
    reading config file mysql
    reading config info for /var/lib/mysql/mysqld.log 
    reading config file named
    reading config info for /var/log/named.log 
    reading config file psacct
    reading config info for /var/account/pacct 
    reading config file redhat-config-network
    reading config info for /var/log/redhat-config-network 
    reading config file rpm
    reading config info for /var/log/rpmpkgs 
    reading config file samba
    reading config info for /var/log/samba/*.log 
    reading config file snmpd
    reading config info for /var/log/snmpd.log 
    reading config file snmpdrpmnew_old
    error: snmpdrpmnew_old:1 duplicate log entry for /var/log/snmpd.log
    rfoshee@hosting [~]# ls -l /var/log|grep exim_mainlog
    -rw-r-----    1 mailnull mail     18156033 Jan  9 19:37 exim_mainlog
    -rw-r-----    1 mailnull mail     229103536 Jan  4 21:39 exim_mainlog.1.gz (I created this manually because the logfile was approaching 2GB since it had not rotated since June 4 2006)
    -rw-r-----    1 mailnull mail      6524402 May 28  2006 exim_mainlog.2.gz
    -rw-r-----    1 mailnull mail      5516398 May 21  2006 exim_mainlog.3.gz
    -rw-r-----    1 mailnull mail      6057066 May 14  2006 exim_mainlog.4.gz
    rfoshee@hosting [~]#
    
    This server is running RHEL3 with either C117 or the release just before it. Running this command on another server actually produces output that one would expect (lots of output with what's been rotated or not, very informative). Any ideas?
     
  8. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Get rid of /etc/logrotate.d/snmpdrpmnew_old
     
  9. bizzy

    bizzy Member

    Joined:
    Nov 30, 2006
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    At a guess you are running Centos 4 or RH Enterprise 4. If so - simply upgrade to logrotate 3.1.6 will fix the /tmp directory problem. If you use Logwatch that will resume reporting normally on the Monday following the first correct Sunday rotation.

    If you are using Centos you need to add the Fasttrack repo and then do a yum update logrotate.

    HTH
     
Loading...

Share This Page