LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-22-2011, 09:49 AM   #1
roopakl
Member
 
Registered: Sep 2011
Posts: 92

Rep: Reputation: Disabled
/tmp


Which program/script_file does automatically delete everything from /tmp folder while booting/shutdown?
 
Old 09-22-2011, 10:00 AM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
This is dependent on what distribution that you are using and your configuration.

Some do and some don't.
 
1 members found this post helpful.
Old 09-22-2011, 10:03 AM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,243

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
As it is a part of your system I would say have a look at your boot scripts.
 
1 members found this post helpful.
Old 09-22-2011, 11:20 AM   #4
loveulinux
Member
 
Registered: Aug 2011
Posts: 68

Rep: Reputation: Disabled
/tmp

Thanks for the reply. I am using Ubuntu-11.04 and CentOS-6 both. So could u plz tell me which file(boot script file) I need to check.


Quote:
Originally Posted by grail View Post
As it is a part of your system I would say have a look at your boot scripts.
 
Old 09-22-2011, 11:31 AM   #5
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
On CentOS, it should be /etc/cron.daily/tmpwatch. (Unless the RHEL folks moved it in v6.)
 
1 members found this post helpful.
Old 09-22-2011, 01:27 PM   #6
roopakl
Member
 
Registered: Sep 2011
Posts: 92

Original Poster
Rep: Reputation: Disabled
/tmp

Hi....Thank u very much.

Quote:
Originally Posted by anomie View Post
On CentOS, it should be /etc/cron.daily/tmpwatch. (Unless the RHEL folks moved it in v6.)
 
Old 09-22-2011, 10:08 PM   #7
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,243

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
On Ubuntu I believe it is :- /etc/init/mounted-tmp.conf
 
1 members found this post helpful.
Old 09-22-2011, 10:33 PM   #8
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,606

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
On Debian Squeeze it is /lib/init/bootclean.sh. It is not supposed to be called directly. Instead it is called from within various boot-scripts in /etc/init.d/.
An excerpt:
Code:
#!/bin/sh
#
# bootclean
#
# Clean /tmp.  Clean /var/run and /var/lock if not mounted as tmpfs
#
# DO NOT RUN AFTER S:55bootmisc.sh and do not run this script directly
# in runlevel S. Instead write an initscript to call it.
#
 
1 members found this post helpful.
Old 09-22-2011, 10:42 PM   #9
dudeman41465
Member
 
Registered: Jun 2005
Location: Kentucky
Distribution: Ubuntu
Posts: 794

Rep: Reputation: 56
I have bleachbit installed just because I've got too much other stuff to worry about to go hunting down and checking every temp folder for files. It should be in your repositories.
 
Old 09-23-2011, 10:32 PM   #10
roopakl
Member
 
Registered: Sep 2011
Posts: 92

Original Poster
Rep: Reputation: Disabled
/tmp

Thanks, I saw that file. it is exactly the same what you are saying.

Quote:
Originally Posted by grail View Post
On Ubuntu I believe it is :- /etc/init/mounted-tmp.conf
 
Old 09-23-2011, 10:36 PM   #11
roopakl
Member
 
Registered: Sep 2011
Posts: 92

Original Poster
Rep: Reputation: Disabled
/tmp

Thank you very much.

Quote:
Originally Posted by crts View Post
On Debian Squeeze it is /lib/init/bootclean.sh. It is not supposed to be called directly. Instead it is called from within various boot-scripts in /etc/init.d/.
An excerpt:
Code:
#!/bin/sh
#
# bootclean
#
# Clean /tmp.  Clean /var/run and /var/lock if not mounted as tmpfs
#
# DO NOT RUN AFTER S:55bootmisc.sh and do not run this script directly
# in runlevel S. Instead write an initscript to call it.
#
 
Old 09-23-2011, 10:50 PM   #12
coralfang
Member
 
Registered: Nov 2010
Location: Bristol, UK
Distribution: Slackware, FreeBSD
Posts: 384
Blog Entries: 2

Rep: Reputation: 96
Depending on how much spare ram you have you could always use tmpfs.

If you do this, nothing in /tmp will survive a reboot. It won't write the files to the harddisk, the exception being swap space (if you happen to be low on ram).

http://en.wikipedia.org/wiki/Tmpfs
http://etutorials.org/Linux+systems/...ries+on+TMPFS/
 
Old 09-24-2011, 12:49 AM   #13
elliott678
Member
 
Registered: Mar 2005
Location: North Carolina
Distribution: Arch
Posts: 977

Rep: Reputation: 72
Quote:
Originally Posted by coralfang View Post
Depending on how much spare ram you have you could always use tmpfs.

If you do this, nothing in /tmp will survive a reboot. It won't write the files to the harddisk, the exception being swap space (if you happen to be low on ram).

http://en.wikipedia.org/wiki/Tmpfs
http://etutorials.org/Linux+systems/...ries+on+TMPFS/
It will also improve performance of some applications.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
tmp filling up with root-tmp diretories steinz Linux - Security 7 04-27-2010 09:34 AM
Can't login, says tmp directory full but tmp file is empty! Could be linked to MySQL? bethanlowder Fedora 7 09-25-2009 08:17 AM
how to securing /tmp , /var/tmp and /dev/shm hackintosh Linux - Security 7 10-18-2007 12:26 AM
Numerous scb_*.tmp files in /tmp dburk Programming 3 08-18-2003 05:28 PM
Newbie question - /tmp /var/tmp Mr happy Linux - Security 3 01-27-2003 02:03 PM


All times are GMT -5. The time now is 05:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration