Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
System aufräumen
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
flammenflitzer
Advocate
Advocate


Joined: 25 Nov 2003
Posts: 3463
Location: Berlin

PostPosted: Fri Jan 12, 2018 4:25 pm    Post subject: System aufräumen Reply with quote

Hallo, ich habe in den letzten Jahren kaum etwas gelöscht. Ich denke, jetzt sollten alte log Dateien gelöscht werden.
Code:
flammenflitzer /home/olaf # ls /var/log | sort
ConsoleKit
Xorg.0.log
Xorg.0.log.old
auth.log
boot.log
btmp
clamav
cron.log
cups
daemon.log
debug
dmesg
emerge-fetch.log
emerge.log
faillog
hp
journal
kdm.log
kern.log
lastlog
lpr.log
messages
mysql
pm-powersave.log
pm-suspend.log
portage
porthole
privoxy
sandbox
sddm.log
tallylog
wtmp

Ich würde alles unter /var/log
Code:
rm -rf /var/log/*

löschen und dann sehen, ob ich mittels logrotate Ordnung halten kann.
Wo finde ich den log von journalctl? Funktioniert logrotate mit systemd?
MfG
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Fri Jan 12, 2018 4:49 pm    Post subject: Reply with quote

Verwendest Du systemd-journald? Wenn ja, kannst Du überlegen, ob Du überhaupt noch syslog / logrotate verwenden willst. Ich habe komplett auf systemd-journald gewechselt und verwende kein syslog / logrotate mehr. Die meisten Dateien in /var/log habe ich dann gelöscht. Du kannst aber auch systemd-journald und syslog parallel verwenden. systemd-journald leitet die Daten dann einfach an syslog weiter.

Die systemd-journald Dateien findest Du entweder in "/var/log/journal" oder in "/run/log/journal" - je nachdem, ob die Daten persistent gespeichert werden oder nicht. Wenn Du auf syslog / logrotate verzichten willst, solltest Du die persistente Speicherung der systemd-journald Daten aktivieren (die Daten werden dann in /var/log/journal gespeichert).

Zu journalctl gibt es einen guten Artikel von Thorsten Leemhuis in der der c't 13/2014, Seite 168. Sehr empfehlenswert.
Back to top
View user's profile Send private message
flammenflitzer
Advocate
Advocate


Joined: 25 Nov 2003
Posts: 3463
Location: Berlin

PostPosted: Fri Jan 12, 2018 5:40 pm    Post subject: Reply with quote

So wie ich das verstehe, kann ich syslog-ng entfernen und die log Einträge unter /var/log löschen. Ohne weitere Einstellungen wird dann systemd eigene Log-Einträge erstellen, die automatisch aktuell gehalten werden?
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Fri Jan 12, 2018 6:05 pm    Post subject: Reply with quote

1) Ich würde zuerst auf systemd-journald umstellen und mich mit journalctl anfreunden. Wenn ich mir dann sicher bin, dass ich die alten Log-Dateien nicht mehr brauche, würde ich zunächst nur die Dateien in /var/log löschen, die von syslog-ng geschrieben werden. Es gibt andere Dateien, wie z.B. lastlog, die Du evtl. auch weiterhin haben möchtest. Wenn Du sie ebenfalls nicht mehr haben möchtest, kannst Du sie löschen.
2) Vermutlich möchtest Du, dass systemd-journald Daten persistent nach /var/log/journal schreibt. Siehe "man journald.conf", Abschnitt "Storage".
3) Wenn Du möchtest, kannst Du die Pakete syslog-ng und logrotate dann entfernen
4) Du kannst eine Art logrotate für systemd-journald einstellen, indem Du den Parameter "SystemMaxUse" in /etc/systemd/journald setzt. Siehe "man journald.conf", Abschnitt "SystemMaxUse".
5) Ich habe in /etc/systemd/journald auch noch den Parameter "MaxLevelStore=info" definiert.
Back to top
View user's profile Send private message
flammenflitzer
Advocate
Advocate


Joined: 25 Nov 2003
Posts: 3463
Location: Berlin

PostPosted: Fri Jan 12, 2018 6:38 pm    Post subject: Reply with quote

Quote:
Ich würde zuerst auf systemd-journald umstellen
? Was muss ich denn da machen? Ich nahm an, das journald nach der Umstellung auf systemd sowieso aktiv ist.
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Fri Jan 12, 2018 7:41 pm    Post subject: Reply with quote

Quote:
Was muss ich denn da machen? Ich nahm an, das journald nach der Umstellung auf systemd sowieso aktiv ist.

Ich weiß ja nicht, wo Du startest - deswegen wollte ich sagen: Voraussetzung für alle weiteren Schritte ist, dass systemd-journald ordentlich läuft und Du Dir mit journalctl das Log ansehen kannst. Das sollte normalerweise der Fall sein, wenn Du nach der Anleitung vorgegangen bist und erfolgreich auf Systemd umgestellt hast. :-)
Back to top
View user's profile Send private message
flammenflitzer
Advocate
Advocate


Joined: 25 Nov 2003
Posts: 3463
Location: Berlin

PostPosted: Sat Jan 13, 2018 8:16 am    Post subject: Reply with quote

ich habe jetzt in /etc/systemd/journald.conf
Code:
Storage=auto
SystemMaxUse=150M
MaxFileSec=3day #1month
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum