Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
tmp löschen
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: 3483
Location: Berlin

PostPosted: Mon Mar 14, 2005 12:59 pm    Post subject: tmp löschen Reply with quote

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
View user's profile Send private message
slick
Bodhisattva
Bodhisattva


Joined: 20 Apr 2003
Posts: 3495

PostPosted: Mon Mar 14, 2005 1:01 pm    Post subject: Reply with quote

Ich hatte bisher keine Probleme mit einem rm -rf /tmp/* /var/tmp/* Natürlich sollte dazu kein Dienst/X laufen.
Back to top
View user's profile Send private message
flammenflitzer
Advocate
Advocate


Joined: 25 Nov 2003
Posts: 3483
Location: Berlin

PostPosted: Mon Mar 14, 2005 1:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
platinumviper
l33t
l33t


Joined: 12 Feb 2004
Posts: 648
Location: Munich, Germany

PostPosted: Mon Mar 14, 2005 1:34 pm    Post subject: Reply with quote

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
Code:
chmod 1777 /tmp
sollte das Problem beseitigen.

platinumviper
_________________
No money back garantee. In case of problems, don't call us, we call you.
Back to top
View user's profile Send private message
flammenflitzer
Advocate
Advocate


Joined: 25 Nov 2003
Posts: 3483
Location: Berlin

PostPosted: Mon Mar 14, 2005 2:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
c07
Veteran
Veteran


Joined: 25 Oct 2002
Posts: 1091

PostPosted: Mon Mar 14, 2005 2:27 pm    Post subject: Reply with quote

Besser /etc/init.d/bootmisc entsprechend ändern. Da wird /tmp sowieso teilweise gesäubert.
Back to top
View user's profile Send private message
flammenflitzer
Advocate
Advocate


Joined: 25 Nov 2003
Posts: 3483
Location: Berlin

PostPosted: Mon Mar 14, 2005 2:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
c07
Veteran
Veteran


Joined: 25 Oct 2002
Posts: 1091

PostPosted: Mon Mar 14, 2005 3:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
flammenflitzer
Advocate
Advocate


Joined: 25 Nov 2003
Posts: 3483
Location: Berlin

PostPosted: Mon Mar 14, 2005 3:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
flammenflitzer
Advocate
Advocate


Joined: 25 Nov 2003
Posts: 3483
Location: Berlin

PostPosted: Mon Mar 14, 2005 3:37 pm    Post subject: Reply with quote

Ich glaube /var/db/pkg sollte man nicht löschen.
Back to top
View user's profile Send private message
c07
Veteran
Veteran


Joined: 25 Oct 2002
Posts: 1091

PostPosted: Mon Mar 14, 2005 3:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
boris64
Veteran
Veteran


Joined: 04 Oct 2003
Posts: 1770
Location: Vechelde/Peine

PostPosted: Tue Apr 12, 2005 2:49 pm    Post subject: Reply with quote

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 :P


[EDIT]hoppla, heute ist der Grammatikfehlerteufel wieder uterwegs :roll: [/EDIT]
_________________
boris64.net 200x / visit my desktop / try these tiny kernel patches ;)
Back to top
View user's profile Send private message
TheCurse
l33t
l33t


Joined: 21 Jun 2004
Posts: 670
Location: Köln

PostPosted: Tue Apr 12, 2005 2:55 pm    Post subject: Reply with quote

Bei mir läuft /tmp über tmpfs, da brauch ich mir gar keine Gedanken zu machen, ob da evtl. etwas nicht gelöscht wird :lol:
Ich fahre bisher gut damit.

MfG
TheCurse
Back to top
View user's profile Send private message
flammenflitzer
Advocate
Advocate


Joined: 25 Nov 2003
Posts: 3483
Location: Berlin

PostPosted: Tue Apr 12, 2005 5:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
andix
Apprentice
Apprentice


Joined: 10 Jul 2004
Posts: 263
Location: Eisenstadt, Austria

PostPosted: Tue Apr 12, 2005 6:47 pm    Post subject: Reply with quote

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
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