[SOLVED] Cannot configure swap

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

[SOLVED] Cannot configure swap

Postby kateto » May 29th, '21, 10:30

Hello,
I can't seem to configure swappiness at boot. Doing it at runtime seems to work:
Code: Select all
[root@Fractal ~]# sysctl vm.swappiness
vm.swappiness = 60
[root@Fractal ~]# sysctl -w vm.swappiness=10
vm.swappiness = 10
[root@Fractal ~]# sysctl vm.swappiness
vm.swappiness = 10

However, Mageia doesn't pick up the settings I put at /etc/sysctl.conf at boot:
Code: Select all
vm.swappiness=10
vm.vfs_cache_pressure=50

This already happened in Mageia 7 and hasn't changed in Mageia 8.
By the way, the original sysctl.conf had "vm.swapiness", which I think is a typo. I changed it to "vm.swappiness" but that didn't make a difference.
Last edited by kateto on May 29th, '21, 12:55, edited 1 time in total.
kateto
 
Posts: 44
Joined: Jul 31st, '12, 13:00

Re: Cannot configure swap

Postby doktor5000 » May 29th, '21, 11:42

Check the man-page for sysctl.d - it should be put in a config droplet below /etc/sysctl.d because /etc/sysctl.conf is not read anymore by default by systemd - this has already been the case for quite some time.
If you change some sysctl via MCC then you should usually have a symlink /etc/sysctl.d/99-sysctl.conf to /etc/sysctl.conf from what I remember. See https://bugs.mageia.org/show_bug.cgi?id=12066
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 16734
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Cannot configure swap

Postby kateto » May 29th, '21, 12:54

Thanks for the reply, putting the parameters in /etc/sysctl.d/99-sysctl.conf took care of the issue.
Truly, discarding out old, non-valid info is one of the biggest hurdles of Linux users. There are so many vestigial components lying around like appendices, just to confound users...
kateto
 
Posts: 44
Joined: Jul 31st, '12, 13:00

Re: Cannot configure swap

Postby jiml8 » May 31st, '21, 19:56

kateto wrote:Truly, discarding out old, non-valid info is one of the biggest hurdles of Linux users. There are so many vestigial components lying around like appendices, just to confound users...


It would be far, far better if that nasty POS systemctl would update configurations when it was changed in a fashion that breaks compatibility. But nooooooooo...
jiml8
 
Posts: 1188
Joined: Jul 7th, '13, 18:09

Re: Cannot configure swap

Postby isadora » May 31st, '21, 20:56

jiml8 wrote:
kateto wrote:that nasty POS...

Come on Jim, you can do that much better, i know..... :D
..........bird from paradise..........

Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
—Antoine de Saint-Exupéry
User avatar
isadora
 
Posts: 2681
Joined: Mar 25th, '11, 16:03
Location: Amsterdam, the Netherlands

Re: Cannot configure swap

Postby jiml8 » Jun 1st, '21, 22:23

Yeah. I could.

When I write something, I am always careful to retain backward compatibility. Should that prove unfeasible, I always build in a migration path and handle the migration.

Systemd has broken my system over, and over, and over. I am very reluctant to update these days because I may wind up with a broken system and be forced to retrace all my steps to see what got broken this time.

For instance, I was not aware that sysctl.conf was no longer being used, until I read it in this thread. Why is sysctl.conf now being ignored? No good reason. Just "we no longer want to do it this way".

Well, that change turns out to be at the root of a number of problems that have been annoying me lately...things I had fixed before with sysctl settings had become unfixed and I had not yet taken the time to chase them down. I had, in fact, not recognized that my sysctl settings had been removed. This includes my complaints about kcompactd. Once I reset my sysctl settings, THAT problem disappeared and my system swap behavior settled down.

Linux with systemd is actually now a lot worse than Windows with respect to updates. At least, Windows fixes the configuration of the system being updated when it changes how things are done. And, mostly, that works. But not linux.
Last edited by doktor5000 on Jun 1st, '21, 23:04, edited 1 time in total.
Reason: removed fullquote
jiml8
 
Posts: 1188
Joined: Jul 7th, '13, 18:09

Re: [SOLVED] Cannot configure swap

Postby doktor5000 » Jun 1st, '21, 23:10

Yeah, it's kinda sad for some parts - the migration part is left to the distribution, instead of handling it directly upstream.

But back on topic, you should have a /etc/sysctl.d/99-sysctl.conf which is a symlink to /etc/sysctl.conf by default. If not, feel free to submit a patch for the above mentioned bugreport or create a new one. Problem is we currently don't have any active maintainer for our initscripts, which is probably the cause why this is not fixed in all cases.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 16734
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany


Return to Basic support

Who is online

Users browsing this forum: morgano and 1 guest