LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-25-2018, 10:27 AM   #1
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
Feature requests: /tmp issues


The first request is for Pat.

For a long time I have mounted /tmp in tmpfs through /etc/fstab. I long have thought this tweak should be configurable for all users.

A common problem posted in this forum is hard disk partitions filling and running out of space. Almost always the culprit is building packages and not cleaning /tmp.

The request is to provide a configurable way to allow users to mount /tmp in tmpfs. I am thinking add /etc/default/tmpfs or something similar. Then modify rc.S to source that file and if configured, mount /tmp similar to the way /var/run is mounted in tmpfs.

Another option might be something like rc.tmpmount, possibly similar to rc.cpufreq.

I am asking for a configurable option and am not asking to change defaults.

Perhaps a sweet twist would be to add a setup.tmpfs script that would be available in pkgtool and the installer.

I will help with any testing if needed.

A second but similar request is for SBo maintainers. I edit all SBo build scripts to delete the compiling cruft. I add the following at the end of build scripts:

Code:
# cleanup
rm -rf $TMP/$PRGNAM*
rm -rf $PKG
This snippet too would be optional and configurable.

Thanks.

Edit: Please ignore the second request.

Last edited by upnort; 04-25-2018 at 09:30 PM.
 
Old 04-25-2018, 11:00 AM   #2
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Rep: Reputation: Disabled
For the second request I must strongly disagree. I often look at the source directory after the package is built when working on the SlackBuild script. Any cleanup should be at the user's discretion, my suggestion would be to create a cronjob that removes files in /tmp/SBo that are older than a certain date. This way you do not have to edit any SlackBuild files and can configure the behavior exactly to your liking.
 
2 members found this post helpful.
Old 04-25-2018, 11:53 AM   #3
elcore
Senior Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 1,753

Rep: Reputation: Disabled
Maybe something like this in fstab:

Code:
tmpfs  /tmp  tmpfs  noexec,noatime,nodev,nosuid,noauto 0 0
And rc.tmpfs to optionally mount this on boot, if made executable.
It could be a problem with noexec, because some want to execute things in there and some don't.
So I was thinking both rc.tmpfs and rc.tmpfs_noexec - but I guess that's too much complexity for no good reason.
 
Old 04-25-2018, 12:13 PM   #4
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Original Poster
Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
Quote:
For the second request I must strongly disagree...Any cleanup should be at the user's discretion
In my original post I wrote "This snippet too would be optional and configurable."

Quote:
Maybe something like this in fstab:
For some years I have used fstab: tmpfs /tmp tmpfs defaults,noatime 0 0

Certainly already doable by most Slackers. I am proposing a more "obvious" configurable method.

Using noauto would seem to provide an on-the-fly toggle, but I think many or most people would want a permanent configuration. Either in tmpfs or not.

I am now thinking rc.S could source rc.tmpmount. rc.tmpmount would source /etc/default/tmpfs. If /etc/default/tmpfs does not exist or is not set to true then /tmp would mount to disk rather than tmpfs. /etc/default/tmpfs could contain something like MOUNT_TMP_TMPFS=.

Icing on the cake would be a setup.tmpfs script.
 
Old 04-25-2018, 12:23 PM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
I do not think mounting /tmp during normal usage (= not at boot time, but later) is safe. I would rather say that is dangerous. Therefore /etc/fstab is ok. I do not really understand what [else] do you want to configure.

I would rather try (although I'm not really familiar with slackware), to set TMP to something unique before build and delete that after build. Either inside /tmp or outside.
 
Old 04-25-2018, 12:59 PM   #6
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
I think you should really want to NOT do this in Slackware. And in particular your SBo-related proposal is something that should be rejected forcefully.
This smells too much of the big distros. You want to take control away from the user.

Instead, you might want to document your improvement proposals in the Slack Docs wiki, so that people can incorporate these themselves if they want. IMO that's the proper way.
 
6 members found this post helpful.
Old 04-25-2018, 07:35 PM   #7
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,220

Rep: Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943
Quote:
Originally Posted by upnort View Post
I edit all SBo build scripts to delete the compiling cruft. I add the following at the end of build scripts:

Code:
# cleanup
rm -rf $TMP/$PRGNAM*
rm -rf $PKG
sbotools covers this. Just configure /etc/sbotools/sbotools.conf to have it done automatically (specifically DISTCLEAN, NOCLEAN, and PKG_DIR).

Quote:
Originally Posted by upnort View Post
This snippet too would be optional and configurable.
I don't think implementation directly in the SlackBuild is a good idea, mainly because there would be an expectation for users that all scripts support this (which means work for SBo maintainers for a problem that is already solved, but also inevitable silent failures for the user). Say it was configurable with some shell variable ($CLEAN or whatever), the user wouldn't immediately know if the SlackBuild supports it or not (you'd have to check the script, check /tmp afterwards etc).

On the other hand, it's a useful functionality to have in an SBo management program. If the program you like to use doesn't support it, I think patches/update requests should go there, rather than the entire base of SlackBuild maintainers.
 
Old 04-25-2018, 08:06 PM   #8
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,900

Rep: Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050
Feature requests: /tmp issues

I'm not at my computer, but I am 90% sure that sbopkg has this feature already implemented as well. Just read the sbopkg.conf.
 
Old 04-25-2018, 08:19 PM   #9
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,220

Rep: Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943
From the man page, it looks like sbopkg currently supports auto-cleaning the unpacked source and package tree (via CLEANUP), but perhaps not the downloaded source or the built package itself.
 
Old 04-25-2018, 08:46 PM   #10
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,661

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
you can remove the old sources using sbopkg -o
 
Old 04-25-2018, 09:30 PM   #11
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Original Poster
Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
Okay, forget about the second request to modify SBo slackbuilds. While I don't use sbopkg, I have been modifyng the SBo slackbuilds for many years to clean /tmp, even long before I started mounting /tmp to tmpfs. 'Nuff said about that topic.

I still think a configurable option to mount /tmp to tmpfs would be a nice addition.
 
Old 04-26-2018, 01:50 AM   #12
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,220

Rep: Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943
I also have /tmp mounted on tmpfs, but isn't /etc/fstab already user configurable? It might not be a bad idea for the installer to ask if the user wants to enable it (if enough RAM is found to make it workable), and if not then the relevant line fstab line would remain commented out. Maybe I'm missing the point, but what's the reason for the other approaches you suggested?
 
Old 04-26-2018, 03:48 AM   #13
franzen
Member
 
Registered: Nov 2012
Distribution: slackware
Posts: 535

Rep: Reputation: 379Reputation: 379Reputation: 379Reputation: 379
Another user-side way of keeping /tmp maintained is, as i sometimes need more space on /tmp than i have ram, and here and there had X-login issues because of a cluttered /tmp:
Code:
cat << EOF >> /etc/rc.d/rc.local_shutdown
# cleaning /tmp and /var/tmp 
find /tmp/ -type f -atime +5 -exec rm '{}' +
find /var/tmp/ -type f -atime +30 -exec rm '{}' +
EOF
 
Old 04-26-2018, 06:50 AM   #14
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
Quote:
Originally Posted by Alien Bob View Post
I think you should really want to NOT do this in Slackware. And in particular your SBo-related proposal is something that should be rejected forcefully.
This smells too much of the big distros. You want to take control away from the user.
auto clean after build is useful, especially if you have /tmp in ram. (think about an update that contains the bigger packages, like Qt)
today tools (some of them) already implement this, so this is an indicator for the usefulness of this function and a wider use-range.
a feature request for this option is therefore legitimate, especially if, as explicit stated, the current default behaviors should not change.
building a bridge to `the smell of big distros`, what ever this means, is a bit extreme, isn't it?
and why configurable options take control away from the user need to be explained, because to me it seems the other way it is.
 
Old 04-26-2018, 08:49 AM   #15
phenixia2003
Senior Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 1,052

Rep: Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008
Hello,

Quote:
Originally Posted by a4z View Post
auto clean after build is useful, especially if you have /tmp in ram. (think about an update that contains the bigger packages, like Qt)
today tools (some of them) already implement this, so this is an indicator for the usefulness of this function and a wider use-range.
a feature request for this option is therefore legitimate, especially if, as explicit stated, the current default behaviors should not change.
building a bridge to `the smell of big distros`, what ever this means, is a bit extreme, isn't it?
and why configurable options take control away from the user need to be explained, because to me it seems the other way it is.

I second that. Furthermore, it is easy to implement something totally optional which could easily be added (automatically) at the end (ie. after /sbin/makepkg ...) of each existing SlackBuilds :

Code:
if [ "${SBO_AUTOCLEAN:-no}" != "no" ] ; then
  rm -rf $TMP $PKG
fi
With this code, user can request cleaning of TMP & PKG directories on the command line :

Code:
$ SBO_AUTOCLEAN=yes ./geany.SlackBuild
The variable SBO_AUTOCLEAN can also be set to yes in ~/.profile. In this case user can prevent cleaning of TMP & PKG directories by passing SBO_AUTOCLEAN=no on the command line of any SlackBuild when needed.

Code:
$ SBO_AUTOCLEAN=no ./geany.SlackBuild
--
SeB
 
  


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
Display issues and install feature tomwildy Linux - Newbie 11 11-02-2011 01:21 PM
Can arp requests cause latency issues? mohtasham1983 Linux - Networking 3 10-14-2009 08:18 PM
LXer: 10 Days of Ubuntu 10.10 Feature Requests LXer Syndicated Linux News 0 10-02-2009 07:00 PM
LXer: This week at LWN: KDE struggles with feature requests LXer Syndicated Linux News 0 08-31-2009 02:00 AM
email notofications: two feature requests ErV LQ Suggestions & Feedback 3 07-02-2008 08:17 AM

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

All times are GMT -5. The time now is 03:32 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