LinuxQuestions.org
Help answer threads with 0 replies.
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 01-15-2018, 09:04 AM   #46
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,223

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320

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: 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
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,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
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: 17
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: 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 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: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
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
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 2,969

Rep: Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548
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



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 is empty! babyphil Slackware 31 11-01-2019 04:58 PM
/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 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 09:06 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