LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 01-15-2018, 09:04 AM   #46
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: Slackware
Posts: 8,110

Rep: Reputation: 3243Reputation: 3243Reputation: 3243Reputation: 3243Reputation: 3243Reputation: 3243Reputation: 3243Reputation: 3243Reputation: 3243Reputation: 3243Reputation: 3243

I agree with the forum's assessment that this is a silly and very costly premature optimization. But eh... it's your personal system.

If you really want to do it, just make sure you set ROOT before you use pkgtools.

If ROOT is set to /pkg, then the "package logs" (which, let's make sure you're clear on this, are actually the database backend used by Slackware's packaging system) will be in /pkg/var/log/packages.

I just checked removepkg's source code.

I have not tried this, and AFAIK no-one here actually has. So feel free to report back on how it worked out.

EDITING TO ADD...

Oh by the way...

The proper way to resolve the issue of excessive logging, if you have that issue, is of course to find out which specific programs are doing too much logging, and then reconfigure those programs in particular.

Last edited by dugan; 01-15-2018 at 09:49 AM.
 
Old 01-15-2018, 12:37 PM   #47
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: Newport News, VA
Distribution: Slackware
Posts: 5,053

Rep: Reputation: 2860Reputation: 2860Reputation: 2860Reputation: 2860Reputation: 2860Reputation: 2860Reputation: 2860Reputation: 2860Reputation: 2860Reputation: 2860Reputation: 2860
Quote:
Originally Posted by dugan View Post
I agree with the forum's assessment that this is a silly and very costly premature optimization. But eh... it's your personal system.

If you really want to do it, just make sure you set ROOT before you use pkgtools.

If ROOT is set to /pkg, then the "package logs" (which, let's make sure you're clear on this, are actually the database backend used by Slackware's packaging system) will be in /pkg/var/log/packages.

I just checked removepkg's source code.

I have not tried this, and AFAIK no-one here actually has. So feel free to report back on how it worked out.
If you set ROOT, wouldn't that also install the packages to the subdirectory of /pkg/, not just the logs?

I think the two best options are to either:
  1. Modify the ADM_DIR variable within the packaging scripts to have the package database stored elsewhere.
  2. Bind mount or symlink separate directories to /var/log/{packages,scripts,removed_packages,removed_scripts}/ to have them preserved outside of /var/log/ without editing the scripts.
 
Old 01-15-2018, 02:33 PM   #48
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,295

Rep: Reputation: 801Reputation: 801Reputation: 801Reputation: 801Reputation: 801Reputation: 801Reputation: 801
Something like this in /etc/fstab:
Code:
tmpfs  /var/log  tmpfs  mode=0755,size=256M   0 0
followed by something like this in rc.local, assuming /var/lib/ is where you have the persistent stuff:
Code:
mkdir -p /var/log/packages /var/log/scripts /var/log/removed_packages /var/log/removed_scripts
mount --bind /var/lib/packages /var/log/packages
mount --bind /var/lib/removed_packages /var/log/removed_packages
mount --bind /var/lib/scripts /var/log/scripts
mount --bind /var/lib/removed_scripts /var/log/removed_scripts
You could do fstab lines for the bind mounts, and that would work fine, as long as you do the directory creation part before that runs. This is one place where systemd's tmpfiles stuff would be handy, but this sort of situation doesn't occur *nearly* often enough to make it worth even considering that pill :-)

I once had an older ARM device that I did exactly this sort of thing on; from memory, I had a separate script that ran from rc.M to do the two code snippets above.
 
4 members found this post helpful.
Old 01-15-2018, 03:20 PM   #49
linuxbawks
Member
 
Registered: Apr 2013
Distribution: Snuckware
Posts: 240

Original Poster
Rep: Reputation: 16
Thanks, I ended up doing something very similar.
I don't think you can generalize that this sort of stuff doesn't happen often to bother not doing anything about it. That's a sign of something else dare I say.

For my own apps I use logging extensively. For any sort of automation logging is imperative. but I have since passed implementing a bedrock system that runs quite to necessitate any sort of extensive logging. The logging emphasis has been offset elsewhere. I still log in tmpfs.

It sinful to say or assume that just because there isn't a use case for something it's not needed. /var/log is open ended as is /var. There is plenty of scope there to put package specific info in a reasonably sane location. In fact I would wager that /var/log is almost next to /var/tmp. Don't put any critical info in /var/log.
 
Old 01-15-2018, 03:50 PM   #50
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: Newport News, VA
Distribution: Slackware
Posts: 5,053

Rep: Reputation: 2860Reputation: 2860Reputation: 2860Reputation: 2860Reputation: 2860Reputation: 2860Reputation: 2860Reputation: 2860Reputation: 2860Reputation: 2860Reputation: 2860
Quote:
Originally Posted by linuxbawks View Post
In fact I would wager that /var/log is almost next to /var/tmp. Don't put any critical info in /var/log.
FWIW, the FHS doesn't state that people should expect /var/log/ to be volatile. And one could argue that /var/log/{packages,scripts,removed_packages,removed_scripts} is a log of the packages being installed/removed and the doinst.sh that is run during installation...
 
Old 01-16-2018, 04:23 AM   #51
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 7,023

Rep: Reputation: 4651Reputation: 4651Reputation: 4651Reputation: 4651Reputation: 4651Reputation: 4651Reputation: 4651Reputation: 4651Reputation: 4651Reputation: 4651Reputation: 4651
Quote:
Originally Posted by linuxbawks View Post
Thanks, I ended up doing something very similar.
I don't think you can generalize that this sort of stuff doesn't happen often to bother not doing anything about it. That's a sign of something else dare I say.

For my own apps I use logging extensively. For any sort of automation logging is imperative. but I have since passed implementing a bedrock system that runs quite to necessitate any sort of extensive logging. The logging emphasis has been offset elsewhere. I still log in tmpfs.

It sinful to say or assume that just because there isn't a use case for something it's not needed. /var/log is open ended as is /var. There is plenty of scope there to put package specific info in a reasonably sane location. In fact I would wager that /var/log is almost next to /var/tmp. Don't put any critical info in /var/log.
Please read the FHS specifications for /var/log and /var/tmp before making these statements.
 
Old 01-21-2018, 07:59 AM   #52
chrisretusn
Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware
Posts: 686

Rep: Reputation: 214Reputation: 214Reputation: 214
Quote:
Originally Posted by Didier Spaier View Post
tmpfs is in RAM so no writes on hard disk or SSD .
Why I quit drinking.
 
  


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
/var/log/packages and /var/log/setup sunny_5252 Slackware 4 05-17-2007 08:17 PM
/var/log/packages Crazed_Mofo VectorLinux 3 04-10-2006 06:54 PM
/var/log/packages is empty! babyphil Slackware 6 03-01-2006 04:57 AM
/var/log/packages vanished Idle Slackware 3 09-19-2005 12:57 PM
/var/log/packages gone! PurpleMotion Slackware 1 10-02-2004 03:04 PM

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

All times are GMT -5. The time now is 10:53 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration