LinuxQuestions.org
Review your favorite Linux distribution.
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, 03:50 AM   #1
manoj.linux
Member
 
Registered: Aug 2007
Posts: 284

Rep: Reputation: 17
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, 04:03 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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, 04:32 AM   #3
manoj.linux
Member
 
Registered: Aug 2007
Posts: 284

Original Poster
Rep: Reputation: 17
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, 04:42 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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, 05:49 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
...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, 12:18 AM   #6
manoj.linux
Member
 
Registered: Aug 2007
Posts: 284

Original Poster
Rep: Reputation: 17
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 02:38 AM
Can't empty the /tmp directory Read-only file system warning roctaiwan Linux - Newbie 8 03-04-2010 06: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 07:17 AM
Query about sockets in /tmp jimieee Linux - General 1 10-01-2007 03:26 AM
Create file using 'touch ./tmp.$$', file tmp.3941 is created, why? huangyanfeng Linux - General 1 04-13-2004 03:36 AM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 04:34 PM.

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
Open Source Consulting | Domain Registration