Is /var/log/packages hardcoded or can it be altered?
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.
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.
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:
Modify the ADM_DIR variable within the packaging scripts to have the package database stored elsewhere.
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.
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.
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.
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...
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.