LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-28-2015, 06:18 AM   #1
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,902

Rep: Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052
What to do with /tmp after all Slackbuilds are built and functioning?


Is it customary to delete /tmp files as described here after desired Slackbuilds are installed? Or should I just leave /tmp alone? Will clearing /tmp affect sbopkg functionality?

I am accustomed to Debian clearing /tmp automagically each reboot. Temp directory is taking up quite a bit of space on my root partition.

Code:
~# du -h --summarize /tmp
4.5G	/tmp
 
Old 05-28-2015, 06:27 AM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,062

Rep: Reputation: Disabled
Quote:
Originally Posted by mralk3 View Post
I Will clearing /tmp affect sbopkg functionality?
Not at all. If you rm -r /tmp/SBo it will be recreated next time you use sbopkg. Or just empty it.

Needless to say, you can archive the packages you just built somewhere.

PS I am impressed how fast you got acquainted with Slackware

Last edited by Didier Spaier; 05-28-2015 at 06:29 AM.
 
Old 05-28-2015, 07:15 AM   #3
lems
Member
 
Registered: May 2004
Distribution: BSD
Posts: 269

Rep: Reputation: 119Reputation: 119
To clear /tmp at every reboot, put this into /etc/rc.d/rc.local_shutdown:
Code:
#! /bin/sh

echo Cleaning /tmp ...
/usr/bin/find /tmp -mindepth 1 -maxdepth 1 -exec /bin/rm -rf {} +;
and make it executable.

edit: For more information, see this article on the wiki:
http://docs.slackware.com/howtos:gen...ree_your_space

Last edited by lems; 05-28-2015 at 07:16 AM.
 
3 members found this post helpful.
Old 05-28-2015, 07:27 AM   #4
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,901

Rep: Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025
I do things manually rather than use 'sbopkg' as I generally want to meddle with the slackbuild in one way or another before running it. I keep both the build directory (in case I ever need to rebuild) and the resultant packages (in case I need to reinstall). Anything left over in /tmp after a build gets cleared out.

Here's an example.
Code:
$ tree .
.
|-- builds
|   |-- libasr
|   |   |-- README
|   |   |-- libasr-1.0.1.tar.gz
|   |   |-- libasr.SlackBuild
|   |   |-- libasr.info
|   |   `-- slack-desc
|   `-- opensmtpd
|       |-- README
|       |-- aliases
|       |-- doinst.sh
|       |-- libasr -> ../libasr
|       |-- opensmtpd-5.4.5p2.tar.gz
|       |-- opensmtpd.SlackBuild
|       |-- opensmtpd.info
|       |-- rc.smtpd
|       `-- slack-desc
`-- packages
    |-- libasr-1.0.1-x86_64-1_local14.1.tgz
    `-- opensmtpd-5.4.5p2-x86_64-2_local14.1.tgz

5 directories, 15 files
The symlink (highlighted blue) I create to remind myself of any needed dependencies and to aid navigation.

Your approach to this sort of thing will evolve over time as you find what works best for you. This is just what works for me.
 
3 members found this post helpful.
Old 05-28-2015, 07:53 AM   #5
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,902

Original Poster
Rep: Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052
Quote:
Originally Posted by Didier Spaier View Post
Not at all. If you rm -r /tmp/SBo it will be recreated next time you use sbopkg. Or just empty it.
Good to know.

Quote:
PS I am impressed how fast you got acquainted with Slackware
Thanks! I have been using Slackware either in a virtual machine or as a hard drive installation for ~3 weeks. The documentation on docs.slackware.com is excellent. The tutorial style format is very helpful in explaining the Slackware way. Once you understand the Slackware philosophy, things just click. I've even started building my own Slackbuilds and storing them on my github account.
 
Old 05-28-2015, 08:00 AM   #6
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,902

Original Poster
Rep: Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052
Quote:
Originally Posted by GazL View Post
I do things manually rather than use 'sbopkg' as I generally want to meddle with the slackbuild in one way or another before running it. I keep both the build directory (in case I ever need to rebuild) and the resultant packages (in case I need to reinstall). Anything left over in /tmp after a build gets cleared out.

(..snip..)

Your approach to this sort of thing will evolve over time as you find what works best for you. This is just what works for me.
I was doing something similar to this before I learned of the instant gratification of sbopkg.

According to the sbopkg.conf man page, it's possible to switch where sbopkg stores it's /tmp and build directories. I will have to mess with that and see if it satisfies my needs.

Though I might start building all my slackbuilds manually again and write a ruby script that queries/scrapes slackbuilds.org and downloads the appropriate files for each Slackbuild. The main thing I like about sbopkg is how it locates each slackbuild and uses the queue files to grab the dependencies too.
 
Old 05-28-2015, 08:35 AM   #7
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,109

Rep: Reputation: 4179Reputation: 4179Reputation: 4179Reputation: 4179Reputation: 4179Reputation: 4179Reputation: 4179Reputation: 4179Reputation: 4179Reputation: 4179Reputation: 4179
Quote:
Originally Posted by mralk3 View Post
According to the sbopkg.conf man page, it's possible to switch where sbopkg stores it's /tmp and build directories. I will have to mess with that and see if it satisfies my needs..
to erase build files at the end of the build queue everytime I launch sbopkg here I have this variable set in /etc/sbopkg/sbopkg.conf
Code:
CLEANUP=${CLEANUP:-YES}
 
3 members found this post helpful.
Old 05-28-2015, 09:10 AM   #8
1337_powerslacker
Member
 
Registered: Nov 2009
Location: Kansas, USA
Distribution: Slackware64-15.0
Posts: 862
Blog Entries: 9

Rep: Reputation: 592Reputation: 592Reputation: 592Reputation: 592Reputation: 592Reputation: 592
Additionally, if you have the RAM to spare, you can mount your SBo directory as a RAMdisk, and then it will clear every time you reboot/shutdown. Quoting from slackalaxy's website:

Code:
I like to speed up the compiling process by compiling in RAM. Almost all additional software that I use is installed from SlackBuilds.org. Scripts from there use /tmp/SBo for compiling, as can be seen from the templates files.

So, I made sure that /tmp/SBo exists and is empty. Then, I just added the following row in my /etc/fstab file:
11
12
13
14
	
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
tmpfs            /dev/shm         tmpfs       defaults         0   0
SBo              /tmp/SBo         tmpfs   nodev,nosuid,size=7G 0   0

Reboot. I have 8GB of RAM, so I set 7GB for the size.

I got the idea from the time I used CRUX and reading their wiki. Another way is to just mount the whole /tmp folder in RAM.
Happy Slacking!
 
2 members found this post helpful.
Old 05-28-2015, 09:22 AM   #9
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,238

Rep: Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322
The first thing I do when installing Slackware is put the following in fstab:

Code:
tmpfs /tmp tmpfs defaults 0 0
 
2 members found this post helpful.
Old 05-28-2015, 09:54 AM   #10
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by dugan View Post
The first thing I do when installing Slackware is put the following in fstab:

Code:
tmpfs /tmp tmpfs defaults 0 0
Does that just expand in size as needed? What if you start getting low on memory? If you remove stuff in /tmp, does it give that space back to the system for memory use?

I ask because I've been wanting to do this for a while, but I'm constantly using a good chunk of my 8GB (stupid Chrome), which is the the max of my motherboard, and I'm worried I'd run out of space on either /tmp or my RAM considering I usually have uptimes of at least several months. Once I build a new computer with more RAM, I'll definitely be doing this.
 
Old 05-28-2015, 11:24 AM   #11
lems
Member
 
Registered: May 2004
Distribution: BSD
Posts: 269

Rep: Reputation: 119Reputation: 119
Quote:
Originally Posted by mralk3 View Post
Though I might start building all my slackbuilds manually again and write a ruby script that queries/scrapes slackbuilds.org and downloads the appropriate files for each Slackbuild. The main thing I like about sbopkg is how it locates each slackbuild and uses the queue files to grab the dependencies too.
No need to scrape the website, since 13.1 there is a file called SLACKBUILDS.TXT that you can use to get information about a package; since some time it also carries the REQUIRES information. Then it's easy to download the SlackBuilds tarball if you got the subdirectory and name of the SlackBuilds (like audio/mpd -> .../audio/mpd.tar.gz). (Personally, I started with a small script that would just download the SlackBuilds tarball with its dependencies and all required sources, but it evolved into something a little bit bigger now.)
 
1 members found this post helpful.
Old 05-28-2015, 11:33 AM   #12
neymac
Member
 
Registered: May 2009
Distribution: Slackware64-14.1
Posts: 138

Rep: Reputation: 19
Quote:
Originally Posted by lems View Post
To clear /tmp at every reboot, put this into /etc/rc.d/rc.local_shutdown:
Code:
#! /bin/sh

echo Cleaning /tmp ...
/usr/bin/find /tmp -mindepth 1 -maxdepth 1 -exec /bin/rm -rf {} +;
and make it executable.

edit: For more information, see this article on the wiki:
http://docs.slackware.com/howtos:gen...ree_your_space
As my ~/.xsession-errors grows to much I added to /etc/rc.d/rc.local_shutdown:
Code:
#Change ~/.xsession-errors to 100 lines if greateer than 1 mb
if [ $(du -b ~/.xsession-errors | cut -f1) -gt 1048576 ]; then
  KEEP_LINES="$(tail -n 100 ~/.xsession-errors)"
  echo "$KEEP_LINES" > ~/.xsession-errors
fi
to reduce its size.
 
Old 05-28-2015, 11:35 AM   #13
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,238

Rep: Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322
Quote:
Originally Posted by bassmadrigal View Post
Does that just expand in size as needed? What if you start getting low on memory? If you remove stuff in /tmp, does it give that space back to the system for memory use?
I don't know the answers to any of these, but I do it on a machine with a 32-bit installation and 4GB of RAM and I've never had problems.

It's a laptop that gets turned on and off as needed though.

Last edited by dugan; 05-28-2015 at 11:36 AM.
 
1 members found this post helpful.
Old 05-28-2015, 11:44 AM   #14
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Leinster, IE
Distribution: Slackware, NetBSD
Posts: 2,181

Rep: Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763
Quote:
Originally Posted by bassmadrigal View Post
Does that just expand in size as needed? What if you start getting low on memory? If you remove stuff in /tmp, does it give that space back to the system for memory use?

I ask because I've been wanting to do this for a while, but I'm constantly using a good chunk of my 8GB (stupid Chrome), which is the the max of my motherboard, and I'm worried I'd run out of space on either /tmp or my RAM considering I usually have uptimes of at least several months. Once I build a new computer with more RAM, I'll definitely be doing this.
You can limit /tmp to a percentage of your RAM:

Code:
tmp /tmp tmpfs defaults,nosuid,size=50%,mode=1777 0 0
 
3 members found this post helpful.
Old 05-28-2015, 12:37 PM   #15
solarfields
Senior Member
 
Registered: Feb 2006
Location: slackalaxy.com
Distribution: Slackware, CRUX
Posts: 1,449

Rep: Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997
mattallmill,

i am flattered you are quoting my humble blog, but please remove the line numbers, because they got messed when you pasted the text. Here's the post if someone is interested:

https://slackalaxy.wordpress.com/201...piling-in-ram/
 
  


Reply



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
[SOLVED] Cannot install from Slackbuilds. Package not put in /tmp. Randicus Draco Albus Slackware 28 07-27-2014 08:07 AM
Bad exit status from /var/tmp/rpm-tmp.Cs9Mt5 (%build) imbrij Linux - Virtualization and Cloud 11 10-27-2012 10:55 AM
Installpkg of a package built w/ src2pkg places the executable in /tmp/... Alexvader Slackware 20 11-05-2009 09:06 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
Use SlackBuilds.org or my own hosting to offer up SlackBuilds? hollywoodb Slackware 6 11-30-2006 08:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:28 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
Open Source Consulting | Domain Registration