View previous topic :: View next topic |
Author |
Message |
flammenflitzer Advocate
Joined: 25 Nov 2003 Posts: 3517 Location: Berlin
|
Posted: Mon Mar 14, 2005 12:59 pm Post subject: tmp löschen |
|
|
Kann mir jemand sagen, welche Dateien man in var und tmp auf keinen Fall löschen sollte? Bei mir ist tmp (und auch var) ziemlich vollgemüllt. Aber ich glaube, da liegen auch einige Sachen, die man nicht löschen sollte.
MfG:?: |
|
Back to top |
|
|
slick Bodhisattva
Joined: 20 Apr 2003 Posts: 3495
|
Posted: Mon Mar 14, 2005 1:01 pm Post subject: |
|
|
Ich hatte bisher keine Probleme mit einem rm -rf /tmp/* /var/tmp/* Natürlich sollte dazu kein Dienst/X laufen. |
|
Back to top |
|
|
flammenflitzer Advocate
Joined: 25 Nov 2003 Posts: 3517 Location: Berlin
|
Posted: Mon Mar 14, 2005 1:21 pm Post subject: |
|
|
Ich hatte jetzt mal einen neue Partition angelegt und diese leer auf tmp eingehangen. Dann konnte ich mich nicht mehr als user grafisch einloggen. Als ich das alte Verzeichnis wieder eingehangen habe war alles i.O.. Vielleicht lage es auch an der fstab
/dev/sdb6 /tmp ext3 auto,defaults 0 0 |
|
Back to top |
|
|
platinumviper l33t
Joined: 12 Feb 2004 Posts: 657 Location: Munich, Germany
|
Posted: Mon Mar 14, 2005 1:34 pm Post subject: |
|
|
flammenflitzer wrote: | Dann konnte ich mich nicht mehr als user grafisch einloggen. |
Vieles funktioniert dann als User nicht, weil Du nicht die nötigen Rechte hast. Ein sollte das Problem beseitigen.
platinumviper _________________ No money back garantee. In case of problems, don't call us, we call you. |
|
Back to top |
|
|
flammenflitzer Advocate
Joined: 25 Nov 2003 Posts: 3517 Location: Berlin
|
Posted: Mon Mar 14, 2005 2:19 pm Post subject: |
|
|
slick wrote: | Ich hatte bisher keine Probleme mit einem rm -rf /tmp/* /var/tmp/* Natürlich sollte dazu kein Dienst/X laufen. |
Also könnte man das auch als script mit rc-update boot hinzufügen? |
|
Back to top |
|
|
c07 Veteran
Joined: 25 Oct 2002 Posts: 1091
|
Posted: Mon Mar 14, 2005 2:27 pm Post subject: |
|
|
Besser /etc/init.d/bootmisc entsprechend ändern. Da wird /tmp sowieso teilweise gesäubert. |
|
Back to top |
|
|
flammenflitzer Advocate
Joined: 25 Nov 2003 Posts: 3517 Location: Berlin
|
Posted: Mon Mar 14, 2005 2:39 pm Post subject: |
|
|
c07 wrote: | Besser /etc/init.d/bootmisc entsprechend ändern. Da wird /tmp sowieso teilweise gesäubert. |
Warum wird tmp nur teilweise gesäubert? Besteht da ein Risiko, wenn man alles löscht? Normal sollten dort doch keine wichtigen Daten (außer von gerade laufenden Diensten) abgelegt sein. |
|
Back to top |
|
|
c07 Veteran
Joined: 25 Oct 2002 Posts: 1091
|
Posted: Mon Mar 14, 2005 3:04 pm Post subject: |
|
|
Das Risiko ist, dass der Benutzer u.U. nicht damit rechnet, dass ihm das System seine Daten löscht. Drum sollte das automatisch nur nach entsprechender Konfiguration passieren (ich nutz mein /tmp z.B. schon für Daten, die ich prinzipiell noch ein bisschen behalten will, die aber nicht backupwürdig sind). Sonst dürfte es aber keine Probleme geben. /tmp kann ja auch ein Dateisystem im RAM sein, das nach dem Booten sowieso leer ist. |
|
Back to top |
|
|
flammenflitzer Advocate
Joined: 25 Nov 2003 Posts: 3517 Location: Berlin
|
Posted: Mon Mar 14, 2005 3:23 pm Post subject: |
|
|
c07 wrote: | Besser /etc/init.d/bootmisc entsprechend ändern. Da wird /tmp sowieso teilweise gesäubert. |
Sollte ich diesen Eintrag
Code: |
#
# Clean up /tmp directory
#
if [[ -z ${CDBOOT} ]] ; then
ebegin "Cleaning /tmp directory"
rm -f /tmp/.X*-lock /tmp/esrv* /tmp/kio* /tmp/jpsock.* /tmp/.fam* &> /dev/null
rm -rf /tmp/.esd* /tmp/orbit-* /tmp/ssh-* /tmp/ksocket-* /tmp/.*-unix &> /dev/null
# Make sure our X11 stuff have the correct permissions
mkdir -p /tmp/.{ICE,X11}-unix &> /dev/null
# chown root.root /tmp/.{ICE,X11}-unix &> /dev/null
chmod 1777 /tmp/.{ICE,X11}-unix &> /dev/null
eend 0
fi
|
wie folgt ändern
Code: |
#
# Clean up /tmp directory
#
if [[ -z ${CDBOOT} ]] ; then
ebegin "Cleaning /tmp directory"
rm -rf /tmp/*-unix &> /dev/null
# Make sure our X11 stuff have the correct permissions
mkdir -p /tmp/.{ICE,X11}-unix &> /dev/null# chown root.root /tmp/.{ICE,X11}-unix &> /dev/null
chmod 1777 /tmp/.{ICE,X11}-unix &> /dev/null
eend 0
fi
|
Und wo kann ich
rm -rf /var/tmp/*
einfügen? |
|
Back to top |
|
|
flammenflitzer Advocate
Joined: 25 Nov 2003 Posts: 3517 Location: Berlin
|
Posted: Mon Mar 14, 2005 3:37 pm Post subject: |
|
|
Ich glaube /var/db/pkg sollte man nicht löschen. |
|
Back to top |
|
|
c07 Veteran
Joined: 25 Oct 2002 Posts: 1091
|
Posted: Mon Mar 14, 2005 3:54 pm Post subject: |
|
|
Sollte im Prinzip funktionieren, wenn du das vermutlich irrtümliche "-unix" rausnimmst, außer dass die Dateien, die mit einem Punkt anfangen, so nicht gelöscht werden (aber komm besser nicht auf die Idee, noch /tmp/.* zu löschen (weil das auch /tmp/.. , sprich dein ganzes System, löscht)). Solang /tmp ein normales Verzeichnis ist (also keine eigene Partition oder ein Symlink), dürfte es das Einfachste sein, es ganz zu löschen und mit den richtigen Rechten neu zu erstellen.
Mit /var/tmp kannst du ganz analog verfahren, aber /var/db/pkg solltest du in der Tat niemals löschen. |
|
Back to top |
|
|
boris64 Veteran
Joined: 04 Oct 2003 Posts: 1770 Location: Vechelde/Peine
|
Posted: Tue Apr 12, 2005 2:49 pm Post subject: |
|
|
hi folks,
zufällig bin ich über diesen "älteren" Thread gestolpert.
Ich habe auch dieses Problem eines "übermüllten" /tmp-Verzeichnisse gehabt
und das mit folgenden Änderungen in /etc/init.d/bootmisc gelöst.
Ist alles ein bischen "verbose", aber ich mag gerne "laute" Scripte *gg*
Bisher fahre ich ganz gut damit
Code: |
...
#
# Clean up /tmp directory
#
if [[ -z ${CDBOOT} ]] ; then
# tmpdirs komplett leermachen
ebegin "Killing tmp-directories"
ebegin " Killing /tmp"
if [ -d /tmp ]; then rm -Rf /tmp; fi
eend 0
ebegin " Killing /var/tmp"
if [ -d /var/tmp ]; then rm -Rf /var/tmp; fi
eend 0
eend 0
# tmpdirs neu erstellen
ebegin "Reviving tmp-directories"
ebegin " Reviving /tmp"
if [ ! -d /tmp ]; then mkdir -p /tmp && chmod 1777 /tmp; fi
eend 0
ebegin " Reviving /var/tmp"
if [ ! -d /var/tmp ]; then mkdir -p /var/tmp && chmod 1777 /var/tmp; fi
eend 0
# Make sure our X11 stuff have the correct permissions
mkdir -p /tmp/.{ICE,X11}-unix &> /dev/null
chown root.root /tmp/.{ICE,X11}-unix &> /dev/null
chmod 1777 /tmp/.{ICE,X11}-unix &> /dev/null
eend 0
fi
#
# Create an 'after-boot' dmesg log
#
...
|
So wird bei jedem Neustart einfach {/tmp,/var/tmp} gelöscht
und danach wieder neu erstellt.
Hoffe mal, jemand kann damit was anfangen.
Aber so ganz nebenbei interessiert natürlich mich auch,
ob das alles nicht noch ein wenig schlauer geht.
Gibt es eventuell auch Kritikpunkte?
greetings
[EDIT]hoppla, heute ist der Grammatikfehlerteufel wieder uterwegs [/EDIT] _________________ boris64.net 200x / visit my desktop / try these tiny kernel patches |
|
Back to top |
|
|
TheCurse l33t
Joined: 21 Jun 2004 Posts: 670 Location: Köln
|
Posted: Tue Apr 12, 2005 2:55 pm Post subject: |
|
|
Bei mir läuft /tmp über tmpfs, da brauch ich mir gar keine Gedanken zu machen, ob da evtl. etwas nicht gelöscht wird
Ich fahre bisher gut damit.
MfG
TheCurse |
|
Back to top |
|
|
flammenflitzer Advocate
Joined: 25 Nov 2003 Posts: 3517 Location: Berlin
|
Posted: Tue Apr 12, 2005 5:31 pm Post subject: |
|
|
Code: |
#
# Clean up /tmp directory
#
if [[ -z ${CDBOOT} ]] ; then
ebegin "Cleaning /tmp directory"
rm -f /tmp/.X*-lock /tmp/esrv* /tmp/kio* /tmp/jpsock.* /tmp/.fam* &> /dev/null
rm -rf /tmp/.esd* /tmp/orbit-* /tmp/ssh-* /tmp/ksocket-* /tmp/.*-unix &> /dev/null
# Make sure our X11 stuff have the correct permissions
mkdir -p /tmp/.{ICE,X11}-unix &> /dev/null
# chown root.root /tmp/.{ICE,X11}-unix &> /dev/null
chmod 1777 /tmp/.{ICE,X11}-unix &> /dev/null
eend 0
fi
|
funktioniet nicht. |
|
Back to top |
|
|
andix Apprentice
Joined: 10 Jul 2004 Posts: 263 Location: Eisenstadt, Austria
|
Posted: Tue Apr 12, 2005 6:47 pm Post subject: |
|
|
So weit ich weiß, soll laut FSH /var/tmp nicht bei jedem Boot gelöscht werden, wobei das bei /tmp durchaus so sein darf. Ob das in der Praxis sinnvoll ist, sei einmal dahingestellt... |
|
Back to top |
|
|
|