Bug 67788

Summary: systemd-sysctl: earlier files 'override' values in higher files
Product: systemd Reporter: Michał Górny <mgorny>
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: normal    
Priority: medium CC: redneb
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Michał Górny 2013-08-05 13:04:59 UTC
systemd-sysctl ignores duplicate assignments currently. For example, on my initial solution this triggered:

$ /usr/lib/systemd/systemd-sysctl 
Duplicate assignment of kernel/sysrq in file '/etc/sysctl.d/99-sysrq.conf', ignoring.

But in effect, this makes the 'override' order of sysctl.d files completely reverse. That is, if you set the same key in '10-foo.conf' and '50-foo.conf', the value from '10-foo.conf' would be applied rather than '50-foo.conf' as you'd expect.
Comment 1 redneb 2013-08-15 07:08:51 UTC
I just ran into the exact same issue. I want to set kernel.sysrq=1 overriding the value from /usr/lib/sysctl.d/50-default.conf but because of the duplicate assignment restriction my only choice is to copy the supplied file to /etc/sysctl.d and modify it there. But then I will lose all future updates that systemd is going to do in /usr/lib/sysctl.d/50-default.conf.
Comment 2 Michał Górny 2013-08-15 11:56:05 UTC
(In reply to comment #1)
> I just ran into the exact same issue. I want to set kernel.sysrq=1
> overriding the value from /usr/lib/sysctl.d/50-default.conf but because of
> the duplicate assignment restriction my only choice is to copy the supplied
> file to /etc/sysctl.d and modify it there. But then I will lose all future
> updates that systemd is going to do in /usr/lib/sysctl.d/50-default.conf.

You can also set it in /etc/sysctl.conf which overrides everything else.
Comment 3 redneb 2013-08-18 00:16:21 UTC
Commit 04bf3c1a [1] contains a fix for that issue so hopefully this will be fixed in systemd-207. I tried it with the gentoo live ebuild and it works.

[1] http://cgit.freedesktop.org/systemd/systemd/commit/?id=04bf3c1a60d82791e0320381e9268f727708f776
Comment 4 Zbigniew Jedrzejewski-Szmek 2013-09-11 20:42:33 UTC
Closing then.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.