Bug 25212 - Changes in /etc/sysctl.conf are not taken into account after a reboot
Summary: Changes in /etc/sysctl.conf are not taken into account after a reboot
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 7
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact:
URL:
Whiteboard: MGA7-64-OK
Keywords: advisory, validated_update
Depends on:
Blocks:
 
Reported: 2019-08-01 14:19 CEST by andre salaun
Modified: 2020-06-10 23:40 CEST (History)
11 users (show)

See Also:
Source RPM: msec
CVE:
Status comment:


Attachments

Description andre salaun 2019-08-01 14:19:24 CEST
Description of problem:
Changes in /etc/sysctl.conf are not taken into account after a reboot

Version-Release number of selected component (if applicable):


How reproducible:
add value in /etc/sysctl and reboot


Steps to Reproduce:
Open a terminal
1. # sysctl vm.swappiness
vm.swappiness = 60
2. # echo "vm.swappiness=10"
3. # sysctl -p
4. # sysctl vm.swappiness
vm.swappiness = 10
5.  reboot
6. # sysctl vm.swappiness
vm.swappiness = 60

A symbolic link must be created for the file /etc/sysctl.conf in /etc/sysctl.d/
This seems to be a regression:
https://bugs.mageia.org/show_bug.cgi?id=12066
Comment 1 Marja Van Waes 2019-08-01 14:45:37 CEST
Maybe this should be done differently nowadays?

Assigning to the base system maintainers.

Assignee: bugsquad => basesystem
CC: (none) => marja11

Comment 2 andre salaun 2019-08-01 14:59:23 CEST
Sorry in step #2 I miscopied the order, I really typed (just to clarify that it's not a mistake on my part) :

# echo "vm.swappiness=10" >> /etc/sysctl.conf
Comment 3 katnatek 2019-08-03 23:25:32 CEST
I don't find info about this, in my system i have a /etc/sysctl.conf.rpmsave , this files are usually created when some change in the format of a file or other changes.

So maybe /etc/sysctl.conf is deprecated and now have to create files under /etc/sysctl.d/

Keep the naming of the file 51-alt-sysrq.conf and create yours like  

echo "vm.swappiness=10" > /etc/sysctl.d/50-swappiness.conf

Remove the simlink to /etc/sysctl.conf in /etc/sysctl.d to test if this works
Comment 4 andre salaun 2019-08-04 12:58:01 CEST
/etc/sysctl.conf.rpmsave is the result of upgrade from Mga6 to Mga7, normal.

But Mga7 creates a /etc/sysctl.conf that contains (verified with a fresh install under vm) :

net.ipv4.icmp_ignore_bogus_error_responses=1
net.ipv4.icmp_echo_ignore_broadcasts=0
net.ipv4.icmp_echo_ignore_all=0
net.ipv4.conf.all.rp_filter=1
net.ipv4.conf.all.log_martians=1

However, this file is not read when the machine is started.

I agree that its place may now be under /etc/syctl.d/ (I'm not a sysctl nor a kernel specialist) but in this case Mga7 (or sysctl) should not create /etc/sysctl.conf and put instructions there that will not be read.

Concerning your workaround method it works since any file contained in /etc/sysctl.d/ is read.

But I prefer naming this file /etc/sysctl.d/50-sysctl.conf (not only swappiness parameters could be added)
However, this bug needs to be fixed. (In the meantime, shouldn't this be added to the errata?)
Comment 5 Jose Manuel López 2019-08-08 10:49:04 CEST
This bug is resolved before. 

- Go to dolphin as root. (In konsole as root: dolphin)
- Go to /etc/sysctl.d
- Create new archive "99-sysctl.conf".
- Write in the archive: vm.swappiness=10 (The value needed)
- Reboot the computer.
- Confirm the value in konsole as root with: cat /proc/sys/vm/swappiness

Regards!!

CC: (none) => joselp

Comment 6 Florian Hubold 2019-09-22 23:49:11 CEST
This seems to be partially a duplicate of bug 12066

CC: (none) => doktor5000
See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=12066

Comment 7 Thomas Backlund 2019-09-23 00:45:34 CEST
It is msec that should be updated to write to /etc/sysctl.d/51-drakx.conf instead of /etc/sysctl.conf

that way it will match with atleast drakx-net uses...

Like this I think:
http://gitweb.mageia.org/software/msec/commit/?id=bad28a9d097f2275b28dc7a7d92f06ed044fb0f6

CC: (none) => tmb
Source RPM: (none) => msec

Comment 8 José Jorge 2019-09-23 08:31:24 CEST
(In reply to Thomas Backlund from comment #7)
> It is msec that should be updated to write to /etc/sysctl.d/51-drakx.conf
> instead of /etc/sysctl.conf
> 
> that way it will match with atleast drakx-net uses...
> 
> Like this I think:
> http://gitweb.mageia.org/software/msec/commit/
> ?id=bad28a9d097f2275b28dc7a7d92f06ed044fb0f6

I don't understand : you did this commit, so is it ready to release a 2.8 msec version?

CC: (none) => lists.jjorge

Comment 9 Thomas Backlund 2019-09-23 12:38:26 CEST
(In reply to José Jorge from comment #8)

> 
> I don't understand : you did this commit, so is it ready to release a 2.8
> msec version?


I committed it as "I think its correct", but still need to check if other drakx bits follows... I know drakx-net uses that file, but I havent checked the rest of the drakx tools yet.
Comment 10 papoteur 2020-05-24 09:05:03 CEST
2.8 has been pushed, including the commit of Thomas.
It is now OK?

CC: (none) => yves.brungard_mageia

Comment 11 andre salaun 2020-05-25 16:16:53 CEST
msec 2.8 does not appear in updates Monday 25 May
Comment 12 David GEIGER 2020-06-06 08:09:01 CEST
Packages in 7/core/updates_testing:
========================
msec-2.8-1.mga7.i586.rpm
msec-gui-2.8-1.mga7.i586.rpm
msec-2.8-1.mga7.x86_64.rpm
msec-gui-2.8-1.mga7.x86_64.rpm

Source RPM: 
========================
msec-2.8-1.mga7.src.rpm

CC: (none) => geiger.david68210

Comment 13 papoteur 2020-06-06 08:29:39 CEST
Advisory
===================
msec used /etc/sysctl.conf file, which is no more read by systemd.
With the modification, it uses now /etc/sysctl.d/51-drakx.conf such that all directives given in this file are taken.
===================
David GEIGER 2020-06-06 08:33:02 CEST

Assignee: basesystem => qa-bugs

Comment 14 Len Lawrence 2020-06-09 19:23:59 CEST
mga7, x86_64

Before update:

# sysctl vm.swappiness
vm.swappiness = 60
# echo "vm.swappiness=10" > /etc/sysctl.conf
# sysctl vm.swappiness
vm.swappiness = 60

Reboot
# sysctl vm.swappiness
vm.swappiness = 60

Updated msec.

# echo "vm.swappiness=10" > /etc/sysctl.d/51-drakx.conf
That file was initially empty but the original file seems to be there still.
# sysctl vm.swappiness
vm.swappiness = 60
# ll /etc/sysctl.conf
-rw-r--r-- 1 root root 196 Jun  9 18:01 /etc/sysctl.conf
# less /etc/sysctl.d/51-drakx.conf
...
vm.swappiness=10
/etc/sysctl.d/51-drakx.conf (END)

sysctl.conf could be removed perhaps.
After another reboot sysctrl found the new value.
# sysctl vm.swappiness
vm.swappiness = 10
# cat /proc/sys/vm/swappiness
10

CC: (none) => tarazed25
Whiteboard: (none) => MGA7-64-OK

Comment 15 Len Lawrence 2020-06-09 19:37:43 CEST
Ignore the remark "That file was....".
Comment 16 Thomas Andrews 2020-06-10 15:23:52 CEST
Validating. Advisory information in Comment 12 and Comment 13.

Keywords: (none) => validated_update
CC: (none) => andrewsfarm, sysadmin-bugs

Nicolas Lécureuil 2020-06-10 22:41:54 CEST

Keywords: (none) => advisory
CC: (none) => mageia

Comment 17 Mageia Robot 2020-06-10 23:40:32 CEST
An update for this issue has been pushed to the Mageia Updates repository.

https://advisories.mageia.org/MGAA-2020-0139.html

Status: NEW => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.