problem mit compress (logrotate)

Apache, Lighttpd, nginx, Cherokee
Post Reply
dw-wolfi
Posts: 12
Joined: 2005-01-09 19:57
 

problem mit compress (logrotate)

Post by dw-wolfi »

Hi,
benutze seit ein paar Tagen einen Strato Rooti mit suse linux 9.0 und visas 2.3 in der Standardausführung. Habe gerade festgestellt, dass die Logdateien nach logrotate nicht komprimiert abgelegt werden. Habe die sharutils mit yast nachinstalliert. Jetzt ist auch /usr/bin/compress vorhanden. Trotzdem funktioniert die Komprimierung nicht. In den messages steht folgender Fehler:
run-crons[8434]: logrotate returned 1
In der /etc/logrotate.d/apache2 steht z.B.

/var/log/apache2/error_log {
compress
dateext
maxage 2
rotate 0
size=+1024k
notifempty
missingok
create 644 root root
postrotate
/etc/init.d/apache2 reload
endscript
}

Die Fehlermeldung von logrotate deutet auf compress hin.

Hat jemand auch so ein Problem oder weiss jemand ob ein weiteres Programm ausser sharutils benötigt wird.
Vielen Dank!
kuntho
Posts: 149
Joined: 2004-10-27 14:22
Location: Küps
Contact:
 

Re: problem mit compress (logrotate)

Post by kuntho »

wenn compress in der config steht, heist das, dass komprimiert werden soll, nicht zwangsweise, dass /usr/bin/compress verwendet wird.

/etc/logrotate.conf:

Code: Select all

# uncomment these to switch compression to bzip2
#compresscmd /usr/bin/bzip2
#uncompresscmd /usr/bin/bunzip2
solange das auskommentiert ist, wird gzip verwendet.
dw-wolfi
Posts: 12
Joined: 2005-01-09 19:57
 

Re: problem mit compress (logrotate)

Post by dw-wolfi »

Ok,
aber warum werden die Logdateien nicht komprimert.

Hier die logrotate.conf
# 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

# uncomment these to switch compression to bzip2
#compresscmd /usr/bin/bzip2
#uncompresscmd /usr/bin/bunzip2

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d


gzip 1.3.5 und bzip 1.0.2 ist installiert

Es wird auch nicht bzip2 komprimiert, bei
# uncomment these to switch compression to bzip2
compresscmd /usr/bin/bzip2
uncompresscmd /usr/bin/bunzip2

Hat denn jemand einen Strato Root mit aktuellem System Suse 9.0 und visas2.3 bei dem die Logdateien komprimiert abgelegt werden?
dw-wolfi
Posts: 12
Joined: 2005-01-09 19:57
 

Re: problem mit compress (logrotate)

Post by dw-wolfi »

Fehler gefunden.

der Fehler liegt in der Grundkonfiguration der
/etc/logrotate.d/apache2

postrotate
/etc/init.d/apache2 reload
endscript


Der Apache 2 wird nicht mit /etc/init.d/apache2 , sondern in dieser Grundkonfiguration mit '/etc/init.d/apache reload' neu geladen. Daher kam bei postrotate der Programmabbruch und die Logdateien wurden nicht komprimiert abgelegt.
Post Reply