Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Logrotate rotiert sporadisch nicht

Empfohlene Antworten

Veröffentlicht

Hallo,

ich habe ein problem mit logrotate unter debian mit Apache, die Apache Logs werden zwar rotiert aber der Apache schreibt weiter in die letzte Datei. Also nach dem rotate in *.1

An sich würde mich das nicht stören, wenn dadurch nicht meine Webserverstatistiken durcheinander kommen würden.

Also, hat dieses Problem auch schon mal jemand gehabt oder weiß jemand was da verkehrt läuft?

Gruß Jaraz

Also nach dem rotate in *.1...

Sieht fast so aus also würde Dein logrotate Script die Logdatei wegmoven...

...das wird so aber nicht funktionieren da Apache noch das Filehandle auf die ursprüngliche Datei offen hat. Und da Du beim wegmoven nur das darüberliegende Verzeichnis anfasst und nicht die Datei selbst schreibt Apache also munter weiter in die alte Datei, auch wenn die jetzt anders heisst.

Vorschläge:

a.)

Suche bzw. schreibe Dir ein logrotate das folgendes macht:

Logdatei kopieren, alte Logdatei cat /dev/nullen, etc...

b.)

Apache stoppen, Logs rotieren, Apache starten.

Aber das wäre ja irgendwie uncool.

c.)

Wenn Du mit dem Linux DefaultLogrotate arbeitest dann ist das vielleicht einfach ne KonfigurationsSache:

>>>>>>>>>>>>>>>>>>>

"/var/log/httpd/access.log" /var/log/httpd/error.log {

rotate 5

mail www@my.org

size=100k

sharedscripts

postrotate

/sbin/killall -HUP httpd

endscript

}

>>>>>>>>>>>>>>>>>>>

In diesem Beispiel dürfte das postrotate Script interessant sein;

sagt allen httpd Prozessen dass Sie ihre Konfiguration neu einlesen sollen...

Apache läuft aber weiter. Könnte funktionieren wenn die httpds dabei die alten FileHandles zumachen und neue aufmachen.

Bye

SystemError

Hi,

so wie es aussieht, fehlte in der Apache Datei nach prerotate ein endscript.

Das hat das ganze nacheinander abarbeiten von logfiles, awstats, usw beeinflusst.

Nachdem ich das endscript eingefügt habe, läuft nun alles und ich hoffe auch dauerhaft. ;)

Gruß Jaraz

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.