LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices

Reply
 
Search this Thread
Old 10-13-2013, 04:50 AM   #1
manoj.linux
Member
 
Registered: Aug 2007
Posts: 231

Rep: Reputation: 15
Question Query on /tmp file system


Hi,

I am having one small query on /tmp file system.

as I know in /tmp files gets cleared after reboot.

what if somebody deletes the files from /tmp file system, wheather it will impact on the functionally of application?

wheather I have to stop application services first then only delete the files from /tmp file system?
 
Old 10-13-2013, 05:03 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Quote:
Originally Posted by manoj.linux View Post
I am having one small query on /tmp file system.

as I know in /tmp files gets cleared after reboot.

what if somebody deletes the files from /tmp file system, wheather it will impact on the functionally of application?

wheather I have to stop application services first then only delete the files from /tmp file system?
Not all the applications use /tmp (or /var/tmp) to temporarily store information.

If an application does use /tmp _and_ it is running at the time the files/dirs in /tmp are removed the application might not behave the way it should. A restart of the application should solve this.

BTW: There's no real need to fully clean /tmp (or /var/tmp) between booting and stopping the system.
 
Old 10-13-2013, 05:32 AM   #3
manoj.linux
Member
 
Registered: Aug 2007
Posts: 231

Original Poster
Rep: Reputation: 15
Thanks Druuna for your prompt response, basically I was facing the issue where after removing files in /tmp file system , it was still showing full used space in /tmp file system,

after rebooting it was showing free disk space.
 
Old 10-13-2013, 05:42 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Quote:
Originally Posted by manoj.linux View Post
Thanks Druuna for your prompt response
You're welcome.

Quote:
basically I was facing the issue where after removing files in /tmp file system , it was still showing full used space in /tmp file system,

after rebooting it was showing free disk space.
This happens when a running application is still using the file that was deleted. The application should release the file once it is stopped. Rebooting the system is a very blunt way of doing that.
 
Old 10-13-2013, 06:49 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,666
Blog Entries: 54

Rep: Reputation: 2952Reputation: 2952Reputation: 2952Reputation: 2952Reputation: 2952Reputation: 2952Reputation: 2952Reputation: 2952Reputation: 2952Reputation: 2952Reputation: 2952
...and to check (after killing the process?) which application still keeps what files open in a directory you can use
Code:
lsof -Pwln -a +D/tmp
 
Old 10-14-2013, 01:18 AM   #6
manoj.linux
Member
 
Registered: Aug 2007
Posts: 231

Original Poster
Rep: Reputation: 15
Many Many THANKS to all.
 
  


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
how to add /tmp file system. manoj.linux Linux - Enterprise 1 08-29-2013 03:38 AM
Can't empty the /tmp directory Read-only file system warning roctaiwan Linux - Newbie 8 03-04-2010 07:24 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
Query about sockets in /tmp jimieee Linux - General 1 10-01-2007 04:26 AM
Create file using 'touch ./tmp.$$', file tmp.3941 is created, why? huangyanfeng Linux - General 1 04-13-2004 04:36 AM


All times are GMT -5. The time now is 07:35 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration