DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 12th July 2008
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
ISO Quartermaster
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 589
Default /tmp & /var/tmp

/tmp is being emptied every time (on shutdown, or boot, idk), /var/tmp not....
however, i i don't really care of /var/tmp/* files....
So i'm wondering if it's bad idea to remove /tmp and symbolically link it to /var/tmp?

/tmp is separate slice (by default 512MB)
/var is 3GB, which is also way to much for me, but that's other story


Is there any reason, i should keep /tmp separate?
Reply With Quote
  #2   (View Single Post)  
Old 12th July 2008
cajunman4life cajunman4life is offline
Real Name: Aaron Graves
Package Pilot
 
Join Date: May 2008
Location: Coolidge, Arizona
Posts: 203
Default

/tmp is for files that really wouldn't make a difference if they disappear when your system reboots.

/var/tmp is typically for holding files that need to persist between reboots (for example, a temporary "/etc" environment during a make buildworld/buildkernel/installkernel.
__________________
I just saved a bunch of money on my car insurance by fleeing the scene of the accident!
Reply With Quote
  #3   (View Single Post)  
Old 12th July 2008
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

This is explained in hier(7).
Reply With Quote
  #4   (View Single Post)  
Old 12th July 2008
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
ISO Quartermaster
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 589
Default

hier (8), explains lot better thank Handbook.... thanks
I'll think of linking /tmp to /var/tmp/nostore or something like that.....
Reply With Quote
  #5   (View Single Post)  
Old 12th July 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

Actually, I've been symlinking /tmp to /var/tmp ever since I use FreeBSD (4 years orso), never had any problems with it.

/tmp gets cleared every day by the periodic(8) script /etc/periodic/daily/110.clean-tmp, there are several options available you can set in /etc/periodic.conf

Code:
# 110.clean-tmps
daily_clean_tmps_enable="NO"                            # Delete stuff daily
daily_clean_tmps_dirs="/tmp"                            # Delete under here
daily_clean_tmps_days="3"                               # If not accessed for
daily_clean_tmps_ignore=".X*-lock .X11-unix .ICE-unix .font-unix .XIM-unix"
daily_clean_tmps_ignore="$daily_clean_tmps_ignore quota.user quota.group"
                                                        # Don't delete these
daily_clean_tmps_verbose="YES"                          # Mention files deleted
You may also want to take a look at /etc/defaults/periodic.conf
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #6   (View Single Post)  
Old 13th July 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

I've never had problems with symlinking /tmp->/var/tmp either and have used clear_tmp_enable since I first found/heard [of] the option.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #7   (View Single Post)  
Old 13th July 2008
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

tis, tis, betrayers of Unix tradition.

I use OpenBSD, I know, "There's no place like home".

Anyway, nvi stores open files as Berkeley db files in /var/tmp, say you're writing a document and the server crashes.. open reboot the files in /tmp are gone, /var/tmp on the other hand remains.

I can't say how wise it is to make the two places one, but, I'm sure you two know what you're doing. (Still, I'd hate to be a user reading hier(7) on your system falling victim to your non-standard /tmp behaviour. ).
Reply With Quote
  #8   (View Single Post)  
Old 13th July 2008
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
ISO Quartermaster
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 589
Default

I'm not sysadmin.... I use FreeBSD at home.... besides i don't like vi for some specific reasons.....

btw is there any app that writes big files to tmp?
Currently i'm reorganizing my disk, and i'm thinking of /var 256M vs 512M top
Reply With Quote
  #9   (View Single Post)  
Old 13th July 2008
cajunman4life cajunman4life is offline
Real Name: Aaron Graves
Package Pilot
 
Join Date: May 2008
Location: Coolidge, Arizona
Posts: 203
Default

On my server I have a 2GB /tmp partition, to allow certain users to go "over their quota" if necessary. For that reason, I don't link /tmp with /var/tmp. Although it probably wouldn't be a problem, I don't want the downtime to re-organize the disk and restore from backup
__________________
I just saved a bunch of money on my car insurance by fleeing the scene of the accident!
Reply With Quote
Old 13th July 2008
ephemera's Avatar
ephemera ephemera is offline
Knuth's homeboy
 
Join Date: Apr 2008
Posts: 537
Default

Quote:
Originally Posted by killasmurf View Post
So i'm wondering if it's bad idea to remove /tmp and symbolically link it to /var/tmp?
its ok to do that.

> Is there any reason, i should keep /tmp separate?

If there is a good reason for keeping /tmp seperate i doubt if it applies to the typical desktop user.
Reply With Quote
Old 13th July 2008
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
ISO Quartermaster
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 589
Default

I just went in BIG problem.....
I did backup my system data.....
and then i resized 1st partition, and some slices....
i removed 1 slice....
Now i fail to restore /usr.... with restore -rf /some/backup/file
It restores few directories, but no files at all......
it didn't even restore anything in usr/src/*


I wonder what did i do wrong..... perhaps i made mistake when i backed up data....


Edit: Huh.... False alarm i just realized that there are not enough space on /tmp when i restore usr from fixit disk......
p.s. i got scared

Last edited by graudeejs; 13th July 2008 at 02:21 PM.
Reply With Quote
Old 13th July 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

Quote:
Anyway, nvi stores open files as Berkeley db files in /var/tmp, say you're writing a document and the server crashes.. open reboot the files in /tmp are gone, /var/tmp on the other hand remains.
No, neither /tmp nor /var/tmp are cleared on boot by default.

Quote:
tis, tis, betrayers of Unix tradition.
Fuck tradition, I can think for my self.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
Old 13th July 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

Quote:
Originally Posted by BSDfan666 View Post
Anyway, nvi stores open files as Berkeley db files in /var/tmp, say you're writing a document and the server crashes.. open reboot the files in /tmp are gone, /var/tmp on the other hand remains.

This is a valid reason if you use nvi with the defaults.


In my case I use vim for my own files and when working on configuration files as root, I don't leave files in unusable states between saves if I can help it -> whether using nvi, vim, or mg.




Quote:
Originally Posted by killasmurf View Post

btw is there any app that writes big files to tmp?
Currently i'm reorganizing my disk, and i'm thinking of /var 256M vs 512M top
some programs and operations will create large files if given large I/O. An example, installing Quake 4 on FreeBSD takes a lot of /tmp space and ark will bomb out if there is not enough space in /tmp

-> hopefully every coder is smart enough to honor $TMPDIR but who says everyone is smart.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
Old 13th July 2008
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
ISO Quartermaster
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 589
Default

Quote:
Originally Posted by TerryP View Post
some programs and operations will create large files if given large I/O. An example, installing Quake 4 on FreeBSD takes a lot of /tmp space and ark will bomb out if there is not enough space in /tmp

-> hopefully every coder is smart enough to honor $TMPDIR but who says everyone is smart.
in this case i will just:
Code:
sudo mkdir /home/tmp
sudo rm -R /var/tmp
sudo ln -s /home/tmp /var/tmp
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:21 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick