Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
deleting /tmp directory
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
shmurfect
n00b
n00b


Joined: 18 Apr 2002
Posts: 19

PostPosted: Fri Apr 19, 2002 5:41 pm    Post subject: deleting /tmp directory Reply with quote

For some reason my /tmp directory isn't being cleared every reboot. It says it is clearing the /tmp directory when the compter starts up, but it doesn't. What can I do to fix this?
Back to top
View user's profile Send private message
daos
n00b
n00b


Joined: 18 Apr 2002
Posts: 50
Location: Virginia, USA

PostPosted: Fri Apr 19, 2002 6:27 pm    Post subject: clear /tmp Reply with quote

I mount the /tmp folder on the RAM using tmpfs, so the content is gone after reboot. Besides, it's faster since all files are on RAM.
Put this line in /ect/fstab

tmpfs /tmp tmpfs defaults 0 0

Note: the default max size for /tmp on RAM is half of ram size. It's dynamic and only the number of files on /tmp occupies the RAM. You can limit the max size (e.g 32MB):
tmpfs /tmp tmpfs size=32m defaults 0 0

You need to have the tmpfs filesystem (formerly shm) compiled in the kernel to make it work.
Back to top
View user's profile Send private message
shmurfect
n00b
n00b


Joined: 18 Apr 2002
Posts: 19

PostPosted: Fri Apr 19, 2002 7:53 pm    Post subject: Re: clear /tmp Reply with quote

daos wrote:
I mount the /tmp folder on the RAM using tmpfs, so the content is gone after reboot. Besides, it's faster since all files are on RAM.
Put this line in /ect/fstab

tmpfs /tmp tmpfs defaults 0 0



hmm - yea - that sounds like a good idea. but say i want large files in the /tmp directory (say iso's or something). Is there any way to have this folder deleted everytime the box is restarted or such without having a ram disk?
Back to top
View user's profile Send private message
daos
n00b
n00b


Joined: 18 Apr 2002
Posts: 50
Location: Virginia, USA

PostPosted: Fri Apr 19, 2002 8:01 pm    Post subject: Reply with quote

You can try this to see if it works.
In the system boot scripts (rc.sysinit for redhat or mandrake), before /tmp is mounted in the script:
rm -rf /tmp
mkdir /tmp
chmod 1777 tmp
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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