Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am trying to get logrotate running on a FreeBSD 8.1 virtual machine. I installed the logrotate with pkg_add, I have created the logrotate.config file and also run:

mkdir /var/lib/

touch /var/lib/logrotate.status

Now when I do:

/usr/local/sbin/logrotate -d /usr/local/etc/logrotate.conf

I get this error:

ELF interpreter /libexec/ld-elf-so.1 not found
Abort

The file ld-elf-so.1 exists:

locate ld-elf.so.1
/libexec/ld-elf.so.1
/usr/libexec/ld-elf.so.1
/usr/share/man/man1/ld-elf.so.1.1.gz
share|improve this question
2  
You might know this, but FreeBSD comes with a log archiver called newsyslog. It's different then logrotate, but works pretty well. –  Stefan Lasiewski Nov 15 '11 at 18:10
    
@Stefan Lasiewski Thanks. I made a new question. Could you take a look please? serverfault.com/questions/331543/… –  Richard Knop Nov 16 '11 at 13:49

1 Answer 1

up vote 6 down vote accepted

You installed a 32-bit Port on a 64-bit OS, or vice-versa.

Use pkg_delete to remove the old version. Try installing via pkg_add -r logrotate

Also, as Stefan noted, FreeBSD comes with newsyslog, which is enabled by default (just edit /etc/newsyslog.conf to add log files as necessary), and does everything 99% of people need.

Edit:
To configure newsyslog for Apache's standard logs add one of the following sets to the config file.

For weekly log rotations, keeping 5 weeks worth, and bzipping the old files:

/var/log/httpd-access.log               644  5     *    $W6D0 JC /var/run/httpd.pid
/var/log/httpd-error.log                644  5     *    $W6D0 JC /var/run/httpd.pid

The "$W6D0" tells it to rotate the logs first thing Sunday morning. For Daily, use $D0. For Monthly, use $M1D0. The format is a touch backwards to read. For instance "$W6D0" means "Rotate of the week on the 6th day, of the day on the 0th hour" (the "D0" part is technically superfluous). This is specifying absolute times, you can also specify intervals instead. If you just put "1" in that field, it will rotate the log every 1 hour.

To rotate the file when it hits 5MB:

/var/log/httpd-access.log               644  5     5000 *     JC /var/run/httpd.pid
/var/log/httpd-error.log                644  5     5000 *     JC /var/run/httpd.pid

The file size field is specified in KB. You can also specify both a time and a size in which case it will trigger a rotation when either conditions are met.

If you have any other specific needs just say so, like if Apache is jailed or chrooted, or you need another application, or you want the old log files in a different location...

share|improve this answer
    
Can I use newsyslog to rotate logs inside my website running under apache? –  Richard Knop Nov 16 '11 at 12:18
    
Thanks. I made a new question. Could you take a look please? serverfault.com/questions/331543/… –  Richard Knop Nov 16 '11 at 13:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.