SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Everytime in run a slackbuild, or src2pkg, besider of creating the install package in /tmp, it creates several folders... some in /tmp/SBo/* ans some others in /tmp/*.
Of course I pan to burn a DVD with the whole set of packages for install/up(downgrade) I have created... I won't wipe them until I have done so...
My question is...
Should i rm -rf all the directories created in /tmp, could this harm my system...?
/tmp is just what it says, temporary. Many distributions clear it at boot time too. As long as you don't delete a file in active use (eg while the package is installing or something similar) you should be ok to delete anything in /tmp.
There are two short shell scripts there that might help you write your own script.
Another trick I use is to assign the $TMP environment variable to /dev/shm, which is created in /etc/fstab. Because that location is in RAM, all of the possible clutter created in $TMP gets deleted with a reboot or shutdown.
You can safely delete everything in it. Move your packages to another directory. If you have enough RAM, you can mount /tmp as tmpfs, and your system will be a lot faster, but the info in /tmp will be lost at reboot, which isn't a problem anyway.
That way, /tmp will be cleared during shutdown.
Never caused me any trouble.
Ah! A perennial question and one for which there are no right answers -- only options with pros and cons.
It is arguably safer to clear /tmp during startup as soon as the file system containing it is mounted (or is mounted rw, if it is on /) because that is the time when there is least likelihood of active processes accessing files on /tmp. There is still a possibility that some files-or-directories in /tmp are required, especially if /tmp is the root of a file system -- in which case it will have lost+found and maybe quota system files.
Following this concept, and having /tmp on /, I modified /etc/rc.d/rc.S (on Slackware 13.0 32-bit) as detailed in this LQ post. Beware! This was controversial in later posts in the same thread including "You should not give advice that will break others's systems". Some illuminating debate ensued but not all the issues raised were fully answered.
I think the best answer potentially has two parts.
1) Regardless of whether you have "enough" ram, put /tmp on a tmpfs. Problem solved.
The tmpfs will use 1/2 of the available ram by default (iirc), but if it's not being used by files, it can still be used by system as memory.
2) Set TMP=/somewhere_else and OUTPUT=/somewhere_else_else in your environment when running the build scripts.
Then, when you're done, you can wipe $TMP completely with no issues at all, and your packages will be left in $OUTPUT.
I'm wondering if a cron job would be a wise idea in that situation if it deleted any file older than a day/hour/what ever.
Not blindly, no. At least in my case, that would wipe my gpg-agent and my ssh-agent directories from /tmp, as they're created when I log in, and I stay logged in for days or even weeks at a time.
I have created a line in my /etc/fstab like this:
tmpfs /tmp tmpfs mode=1777 0 0
Now /tmp is cleaned everytime I exit my computer. Works great for me so far.
I'm wondering if a cron job would be a wise idea in that situation if it deleted any file older than a day/hour/what ever.
See the thread I linked above; it has some useful discussion related to your wondering, including about tmpwatch which is designed for tmp file housekeeping.
Everytime in run a slackbuild, or src2pkg, besider of creating the install package in /tmp, it creates several folders... some in /tmp/SBo/* ans some others in /tmp/*.
I always just delete everything in /tmp/SBo/ after I install my slackbuilds.
Quote:
Originally Posted by Alexvader
Of course I pan to burn a DVD with the whole set of packages for install/up(downgrade) I have created... I won't wipe them until I have done so...
I save all my slackbuild packages in a "slackbuilds" directory in my home directory. This way I can easily reinstall them all if I ever reinstall Slackware. I have never need to reinstall Slackware though.
I can also easily move them to my laptop if I need them there.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.