Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] systemd: make /etc/sysctl.conf have real effect
@ 2014-11-06  7:32 Chen Qi
  2014-11-06  7:32 ` [PATCH 1/1] " Chen Qi
  0 siblings, 1 reply; 11+ messages in thread
From: Chen Qi @ 2014-11-06  7:32 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit d7a277b35bcc67050046c76fb70412101679a545:

  docbook-xsl-stylesheets: add perl to RDEPENDS (2014-11-04 10:20:34 +0000)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib ChenQi/systemd-sysctl
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=ChenQi/systemd-sysctl

Chen Qi (1):
  systemd: make /etc/sysctl.conf have real effect

 meta/recipes-core/systemd/systemd_216.bb | 3 +++
 1 file changed, 3 insertions(+)

-- 
1.9.1



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/1] systemd: make /etc/sysctl.conf have real effect
  2014-11-06  7:32 [PATCH 0/1] systemd: make /etc/sysctl.conf have real effect Chen Qi
@ 2014-11-06  7:32 ` Chen Qi
  2014-11-06  7:48   ` Koen Kooi
  0 siblings, 1 reply; 11+ messages in thread
From: Chen Qi @ 2014-11-06  7:32 UTC (permalink / raw)
  To: openembedded-core

In systemd, /etc/sysctl.conf is actually ignored by systemd-sysctl,
because this command only examine *.conf files under a bunch of directories
like /etc/sysctl.d or /usr/lib/sysctl.d.

The problem is we are used to configuring kernel parameters in /etc/sysctl.conf,
so it would be really strange if the configuration in that file doesn't have any
effect.

This patch reference Fedora's solution to this problem, creating a symlink to
/etc/sysctl.conf under /etc/sysctl.d/.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-core/systemd/systemd_216.bb | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/recipes-core/systemd/systemd_216.bb b/meta/recipes-core/systemd/systemd_216.bb
index 27a5d92..b730b13 100644
--- a/meta/recipes-core/systemd/systemd_216.bb
+++ b/meta/recipes-core/systemd/systemd_216.bb
@@ -148,6 +148,9 @@ do_install() {
 
 	# Enable journal to forward message to syslog daemon
 	sed -i -e 's/.*ForwardToSyslog.*/ForwardToSyslog=yes/' ${D}${sysconfdir}/systemd/journald.conf
+
+	# Make /etc/sysctl.conf have real effect on systemd based systems
+	ln -sf ../sysctl.conf ${D}${sysconfdir}/sysctl.d/99-sysctl.conf
 }
 
 do_install_ptest () {
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] systemd: make /etc/sysctl.conf have real effect
  2014-11-06  7:32 ` [PATCH 1/1] " Chen Qi
@ 2014-11-06  7:48   ` Koen Kooi
  2014-11-06  7:59     ` ChenQi
  0 siblings, 1 reply; 11+ messages in thread
From: Koen Kooi @ 2014-11-06  7:48 UTC (permalink / raw)
  To: Chen Qi; +Cc: openembedded-core


Op 6 nov. 2014, om 08:32 heeft Chen Qi <Qi.Chen@windriver.com> het volgende geschreven:

> In systemd, /etc/sysctl.conf is actually ignored by systemd-sysctl,
> because this command only examine *.conf files under a bunch of directories
> like /etc/sysctl.d or /usr/lib/sysctl.d.
> 
> The problem is we are used to configuring kernel parameters in /etc/sysctl.conf,
> so it would be really strange if the configuration in that file doesn't have any
> effect.
> 
> This patch reference Fedora's solution to this problem, creating a symlink to
> /etc/sysctl.conf under /etc/sysctl.d/.

Shouldn't this be done in procps instead?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] systemd: make /etc/sysctl.conf have real effect
  2014-11-06  7:48   ` Koen Kooi
@ 2014-11-06  7:59     ` ChenQi
  2014-11-06 10:33       ` Koen Kooi
  0 siblings, 1 reply; 11+ messages in thread
From: ChenQi @ 2014-11-06  7:59 UTC (permalink / raw)
  To: Koen Kooi; +Cc: openembedded-core

On 11/06/2014 03:48 PM, Koen Kooi wrote:
> Op 6 nov. 2014, om 08:32 heeft Chen Qi <Qi.Chen@windriver.com> het volgende geschreven:
>
>> In systemd, /etc/sysctl.conf is actually ignored by systemd-sysctl,
>> because this command only examine *.conf files under a bunch of directories
>> like /etc/sysctl.d or /usr/lib/sysctl.d.
>>
>> The problem is we are used to configuring kernel parameters in /etc/sysctl.conf,
>> so it would be really strange if the configuration in that file doesn't have any
>> effect.
>>
>> This patch reference Fedora's solution to this problem, creating a symlink to
>> /etc/sysctl.conf under /etc/sysctl.d/.
> Shouldn't this be done in procps instead?
>

Actually, the problem is not about `sysctl' command.
procps provides `sysctl', but busybox also provides this command.
It's very possible that on our generated image, procps is not installed 
but `sysctl' command is available.
Both busybox's and procps's `sysctl' command takes /etc/sysctl.conf into 
consideration.

Now, systemd provides a similar utility called `systemd-sysctl' which is 
executed at boot time via systemd-sysctl.service.

So our actually problem is that systemd-sysctl ignores /etc/sysctl.conf, 
which makes it somewhat strange, especially to users who are used to 
configuring parameters in sysctl.conf.
And this patch solves this problem by adding a symlink under /etc/sysctl.d/.

That's why I think we should put this in systemd.

Best Regards,
Chen Qi


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] systemd: make /etc/sysctl.conf have real effect
  2014-11-06  7:59     ` ChenQi
@ 2014-11-06 10:33       ` Koen Kooi
  2014-11-06 11:59         ` ChenQi
  0 siblings, 1 reply; 11+ messages in thread
From: Koen Kooi @ 2014-11-06 10:33 UTC (permalink / raw)
  To: ChenQi; +Cc: openembedded-core


> Op 6 nov. 2014, om 08:59 heeft ChenQi <Qi.Chen@windriver.com> het volgende geschreven:
> 
> On 11/06/2014 03:48 PM, Koen Kooi wrote:
>> Op 6 nov. 2014, om 08:32 heeft Chen Qi <Qi.Chen@windriver.com> het volgende geschreven:
>> 
>>> In systemd, /etc/sysctl.conf is actually ignored by systemd-sysctl,
>>> because this command only examine *.conf files under a bunch of directories
>>> like /etc/sysctl.d or /usr/lib/sysctl.d.
>>> 
>>> The problem is we are used to configuring kernel parameters in /etc/sysctl.conf,
>>> so it would be really strange if the configuration in that file doesn't have any
>>> effect.
>>> 
>>> This patch reference Fedora's solution to this problem, creating a symlink to
>>> /etc/sysctl.conf under /etc/sysctl.d/.
>> Shouldn't this be done in procps instead?
>> 
> 
> Actually, the problem is not about `sysctl' command.
> procps provides `sysctl', but busybox also provides this command.
> It's very possible that on our generated image, procps is not installed but `sysctl' command is available.
> Both busybox's and procps's `sysctl' command takes /etc/sysctl.conf into consideration.

Right, but only procps installs that file.

> Now, systemd provides a similar utility called `systemd-sysctl' which is executed at boot time via systemd-sysctl.service.
> 
> So our actually problem is that systemd-sysctl ignores /etc/sysctl.conf, which makes it somewhat strange, especially to users who are used to configuring parameters in sysctl.conf.
> And this patch solves this problem by adding a symlink under /etc/sysctl.d/.
> 
> That's why I think we should put this in systemd.

You're adding a symlink to a file which only exists if you install procps, which isn't in RDEPENDS.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] systemd: make /etc/sysctl.conf have real effect
  2014-11-06 10:33       ` Koen Kooi
@ 2014-11-06 11:59         ` ChenQi
  2014-11-06 13:29           ` Koen Kooi
  0 siblings, 1 reply; 11+ messages in thread
From: ChenQi @ 2014-11-06 11:59 UTC (permalink / raw)
  To: Koen Kooi; +Cc: openembedded-core



On 11/06/2014 06:33 PM, Koen Kooi wrote:
>> Op 6 nov. 2014, om 08:59 heeft ChenQi <Qi.Chen@windriver.com> het volgende geschreven:
>>
>> On 11/06/2014 03:48 PM, Koen Kooi wrote:
>>> Op 6 nov. 2014, om 08:32 heeft Chen Qi <Qi.Chen@windriver.com> het volgende geschreven:
>>>
>>>> In systemd, /etc/sysctl.conf is actually ignored by systemd-sysctl,
>>>> because this command only examine *.conf files under a bunch of directories
>>>> like /etc/sysctl.d or /usr/lib/sysctl.d.
>>>>
>>>> The problem is we are used to configuring kernel parameters in /etc/sysctl.conf,
>>>> so it would be really strange if the configuration in that file doesn't have any
>>>> effect.
>>>>
>>>> This patch reference Fedora's solution to this problem, creating a symlink to
>>>> /etc/sysctl.conf under /etc/sysctl.d/.
>>> Shouldn't this be done in procps instead?
>>>
>> Actually, the problem is not about `sysctl' command.
>> procps provides `sysctl', but busybox also provides this command.
>> It's very possible that on our generated image, procps is not installed but `sysctl' command is available.
>> Both busybox's and procps's `sysctl' command takes /etc/sysctl.conf into consideration.
> Right, but only procps installs that file.

As busybox provides `sysctl' utility, is it reasonable that it also 
provides a corresponding configuration file (/etc/sysctl.conf)? Should 
we make a patch for busybox?


>> Now, systemd provides a similar utility called `systemd-sysctl' which is executed at boot time via systemd-sysctl.service.
>>
>> So our actually problem is that systemd-sysctl ignores /etc/sysctl.conf, which makes it somewhat strange, especially to users who are used to configuring parameters in sysctl.conf.
>> And this patch solves this problem by adding a symlink under /etc/sysctl.d/.
>>
>> That's why I think we should put this in systemd.
> You're adding a symlink to a file which only exists if you install procps, which isn't in RDEPENDS.
>

As I said before, procps is *not* necessary for the sysctl mechanism to 
have effect.
(Think about systemd-based core-image-minimal image.)

Busybox provides `sysctl', systemd provides `systemd-sysctl'.
(It's an easy program, there might exist other packages that provide it 
too.)

/etc/sysctl.conf is a configuration file which is very likely to be 
modified or created by administrators to configure kernel parameters.
(You can't expect administrators to all start learning systemd, trying 
to understand the gap and differences. In addition, they may have 
scripts that edit /etc/sysctl.conf to automate their work.)

The point of the symlink is to ensure that when users edit 
/etc/sysctl.conf (or create one), configurations in that file will have 
effect at boot time.

Just think about this problem from a standpoint of user experience.

Best Regards,
Chen Qi


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] systemd: make /etc/sysctl.conf have real effect
  2014-11-06 11:59         ` ChenQi
@ 2014-11-06 13:29           ` Koen Kooi
  2014-11-06 22:38             ` Randy Witt
  0 siblings, 1 reply; 11+ messages in thread
From: Koen Kooi @ 2014-11-06 13:29 UTC (permalink / raw)
  To: ChenQi; +Cc: openembedded-core


Op 6 nov. 2014, om 12:59 heeft ChenQi <Qi.Chen@windriver.com> het volgende geschreven:

> 
> 
> On 11/06/2014 06:33 PM, Koen Kooi wrote:
>>> Op 6 nov. 2014, om 08:59 heeft ChenQi <Qi.Chen@windriver.com> het volgende geschreven:
>>> 
>>> On 11/06/2014 03:48 PM, Koen Kooi wrote:
>>>> Op 6 nov. 2014, om 08:32 heeft Chen Qi <Qi.Chen@windriver.com> het volgende geschreven:
>>>> 
>>>>> In systemd, /etc/sysctl.conf is actually ignored by systemd-sysctl,
>>>>> because this command only examine *.conf files under a bunch of directories
>>>>> like /etc/sysctl.d or /usr/lib/sysctl.d.
>>>>> 
>>>>> The problem is we are used to configuring kernel parameters in /etc/sysctl.conf,
>>>>> so it would be really strange if the configuration in that file doesn't have any
>>>>> effect.
>>>>> 
>>>>> This patch reference Fedora's solution to this problem, creating a symlink to
>>>>> /etc/sysctl.conf under /etc/sysctl.d/.
>>>> Shouldn't this be done in procps instead?
>>>> 
>>> Actually, the problem is not about `sysctl' command.
>>> procps provides `sysctl', but busybox also provides this command.
>>> It's very possible that on our generated image, procps is not installed but `sysctl' command is available.
>>> Both busybox's and procps's `sysctl' command takes /etc/sysctl.conf into consideration.
>> Right, but only procps installs that file.
> 
> As busybox provides `sysctl' utility, is it reasonable that it also provides a corresponding configuration file (/etc/sysctl.conf)? Should we make a patch for busybox?
> 
> 
>>> Now, systemd provides a similar utility called `systemd-sysctl' which is executed at boot time via systemd-sysctl.service.
>>> 
>>> So our actually problem is that systemd-sysctl ignores /etc/sysctl.conf, which makes it somewhat strange, especially to users who are used to configuring parameters in sysctl.conf.
>>> And this patch solves this problem by adding a symlink under /etc/sysctl.d/.
>>> 
>>> That's why I think we should put this in systemd.
>> You're adding a symlink to a file which only exists if you install procps, which isn't in RDEPENDS.
>> 
> 
> As I said before, procps is *not* necessary for the sysctl mechanism to have effect.
> (Think about systemd-based core-image-minimal image.)
> 
> Busybox provides `sysctl', systemd provides `systemd-sysctl'.
> (It's an easy program, there might exist other packages that provide it too.)
> 
> /etc/sysctl.conf is a configuration file which is very likely to be modified or created by administrators to configure kernel parameters.
> (You can't expect administrators to all start learning systemd, trying to understand the gap and differences. In addition, they may have scripts that edit /etc/sysctl.conf to automate their work.)
> 
> The point of the symlink is to ensure that when users edit /etc/sysctl.conf (or create one), configurations in that file will have effect at boot time.
> 
> Just think about this problem from a standpoint of user experience.

You still haven't convinced me that shipping a broken symlink is a good idea. I'm pretty sure it's not even allowed in out commit guidelines.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] systemd: make /etc/sysctl.conf have real effect
  2014-11-06 13:29           ` Koen Kooi
@ 2014-11-06 22:38             ` Randy Witt
  2014-11-07  3:34               ` ChenQi
  0 siblings, 1 reply; 11+ messages in thread
From: Randy Witt @ 2014-11-06 22:38 UTC (permalink / raw)
  To: Koen Kooi, ChenQi; +Cc: openembedded-core

On 11/06/2014 05:29 AM, Koen Kooi wrote:
>
> Op 6 nov. 2014, om 12:59 heeft ChenQi <Qi.Chen@windriver.com> het volgende geschreven:
>
>>
>>
>> On 11/06/2014 06:33 PM, Koen Kooi wrote:
>>>> Op 6 nov. 2014, om 08:59 heeft ChenQi <Qi.Chen@windriver.com> het volgende geschreven:
>>>>
>>>> On 11/06/2014 03:48 PM, Koen Kooi wrote:
>>>>> Op 6 nov. 2014, om 08:32 heeft Chen Qi <Qi.Chen@windriver.com> het volgende geschreven:
>>>>>
>>>>>> In systemd, /etc/sysctl.conf is actually ignored by systemd-sysctl,
>>>>>> because this command only examine *.conf files under a bunch of directories
>>>>>> like /etc/sysctl.d or /usr/lib/sysctl.d.
>>>>>>
>>>>>> The problem is we are used to configuring kernel parameters in /etc/sysctl.conf,
>>>>>> so it would be really strange if the configuration in that file doesn't have any
>>>>>> effect.
>>>>>>
>>>>>> This patch reference Fedora's solution to this problem, creating a symlink to
>>>>>> /etc/sysctl.conf under /etc/sysctl.d/.
>>>>> Shouldn't this be done in procps instead?
>>>>>
>>>> Actually, the problem is not about `sysctl' command.
>>>> procps provides `sysctl', but busybox also provides this command.
>>>> It's very possible that on our generated image, procps is not installed but `sysctl' command is available.
>>>> Both busybox's and procps's `sysctl' command takes /etc/sysctl.conf into consideration.
>>> Right, but only procps installs that file.
>>
>> As busybox provides `sysctl' utility, is it reasonable that it also provides a corresponding configuration file (/etc/sysctl.conf)? Should we make a patch for busybox?
>>
>>
>>>> Now, systemd provides a similar utility called `systemd-sysctl' which is executed at boot time via systemd-sysctl.service.
>>>>
>>>> So our actually problem is that systemd-sysctl ignores /etc/sysctl.conf, which makes it somewhat strange, especially to users who are used to configuring parameters in sysctl.conf.
>>>> And this patch solves this problem by adding a symlink under /etc/sysctl.d/.
>>>>
>>>> That's why I think we should put this in systemd.
>>> You're adding a symlink to a file which only exists if you install procps, which isn't in RDEPENDS.
>>>
>>
>> As I said before, procps is *not* necessary for the sysctl mechanism to have effect.
>> (Think about systemd-based core-image-minimal image.)
>>
>> Busybox provides `sysctl', systemd provides `systemd-sysctl'.
>> (It's an easy program, there might exist other packages that provide it too.)
>>
>> /etc/sysctl.conf is a configuration file which is very likely to be modified or created by administrators to configure kernel parameters.
>> (You can't expect administrators to all start learning systemd, trying to understand the gap and differences. In addition, they may have scripts that edit /etc/sysctl.conf to automate their work.)
>>
>> The point of the symlink is to ensure that when users edit /etc/sysctl.conf (or create one), configurations in that file will have effect at boot time.
>>
>> Just think about this problem from a standpoint of user experience.
>
> You still haven't convinced me that shipping a broken symlink is a good idea. I'm pretty sure it's not even allowed in out commit guidelines.
>
I agree, even in Fedora's case, both /etc/sysctl.conf and 
/etc/sysctl.d/99-sysctl.conf come from the same package, initscripts-9.51-2.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] systemd: make /etc/sysctl.conf have real effect
  2014-11-06 22:38             ` Randy Witt
@ 2014-11-07  3:34               ` ChenQi
  2014-11-07 14:29                 ` Martin Jansa
  0 siblings, 1 reply; 11+ messages in thread
From: ChenQi @ 2014-11-07  3:34 UTC (permalink / raw)
  To: Randy Witt, Koen Kooi; +Cc: openembedded-core

On 11/07/2014 06:38 AM, Randy Witt wrote:
> On 11/06/2014 05:29 AM, Koen Kooi wrote:
>>
>> Op 6 nov. 2014, om 12:59 heeft ChenQi <Qi.Chen@windriver.com> het 
>> volgende geschreven:
>>
>>>
>>>
>>> On 11/06/2014 06:33 PM, Koen Kooi wrote:
>>>>> Op 6 nov. 2014, om 08:59 heeft ChenQi <Qi.Chen@windriver.com> het 
>>>>> volgende geschreven:
>>>>>
>>>>> On 11/06/2014 03:48 PM, Koen Kooi wrote:
>>>>>> Op 6 nov. 2014, om 08:32 heeft Chen Qi <Qi.Chen@windriver.com> 
>>>>>> het volgende geschreven:
>>>>>>
>>>>>>> In systemd, /etc/sysctl.conf is actually ignored by systemd-sysctl,
>>>>>>> because this command only examine *.conf files under a bunch of 
>>>>>>> directories
>>>>>>> like /etc/sysctl.d or /usr/lib/sysctl.d.
>>>>>>>
>>>>>>> The problem is we are used to configuring kernel parameters in 
>>>>>>> /etc/sysctl.conf,
>>>>>>> so it would be really strange if the configuration in that file 
>>>>>>> doesn't have any
>>>>>>> effect.
>>>>>>>
>>>>>>> This patch reference Fedora's solution to this problem, creating 
>>>>>>> a symlink to
>>>>>>> /etc/sysctl.conf under /etc/sysctl.d/.
>>>>>> Shouldn't this be done in procps instead?
>>>>>>
>>>>> Actually, the problem is not about `sysctl' command.
>>>>> procps provides `sysctl', but busybox also provides this command.
>>>>> It's very possible that on our generated image, procps is not 
>>>>> installed but `sysctl' command is available.
>>>>> Both busybox's and procps's `sysctl' command takes 
>>>>> /etc/sysctl.conf into consideration.
>>>> Right, but only procps installs that file.
>>>
>>> As busybox provides `sysctl' utility, is it reasonable that it also 
>>> provides a corresponding configuration file (/etc/sysctl.conf)? 
>>> Should we make a patch for busybox?
>>>
>>>
>>>>> Now, systemd provides a similar utility called `systemd-sysctl' 
>>>>> which is executed at boot time via systemd-sysctl.service.
>>>>>
>>>>> So our actually problem is that systemd-sysctl ignores 
>>>>> /etc/sysctl.conf, which makes it somewhat strange, especially to 
>>>>> users who are used to configuring parameters in sysctl.conf.
>>>>> And this patch solves this problem by adding a symlink under 
>>>>> /etc/sysctl.d/.
>>>>>
>>>>> That's why I think we should put this in systemd.
>>>> You're adding a symlink to a file which only exists if you install 
>>>> procps, which isn't in RDEPENDS.
>>>>
>>>
>>> As I said before, procps is *not* necessary for the sysctl mechanism 
>>> to have effect.
>>> (Think about systemd-based core-image-minimal image.)
>>>
>>> Busybox provides `sysctl', systemd provides `systemd-sysctl'.
>>> (It's an easy program, there might exist other packages that provide 
>>> it too.)
>>>
>>> /etc/sysctl.conf is a configuration file which is very likely to be 
>>> modified or created by administrators to configure kernel parameters.
>>> (You can't expect administrators to all start learning systemd, 
>>> trying to understand the gap and differences. In addition, they may 
>>> have scripts that edit /etc/sysctl.conf to automate their work.)
>>>
>>> The point of the symlink is to ensure that when users edit 
>>> /etc/sysctl.conf (or create one), configurations in that file will 
>>> have effect at boot time.
>>>
>>> Just think about this problem from a standpoint of user experience.
>>
>> You still haven't convinced me that shipping a broken symlink is a 
>> good idea. I'm pretty sure it's not even allowed in out commit 
>> guidelines.
>>
> I agree, even in Fedora's case, both /etc/sysctl.conf and 
> /etc/sysctl.d/99-sysctl.conf come from the same package, 
> initscripts-9.51-2.
>
>

Koen & Witt,

When I started out to solve this problem, I basically came up with three 
solutions. Please see details below. I chose to use solution 3 because I 
think it's better than the other two. Please tell me which one you like, 
or please tell me your solution.

Solution 1:
Make 'sysctl.conf' managed by ALTERNATIVES mechanism in OE. Busybox, 
procps and systemd all provide this file. And the symlink is still in 
systemd.
(My opinion for this one: over engineering)

Solution 2:
Make base-files provide sysctl.conf and /etc/sysctl.d/99-sysctl.conf (in 
case of systemd). procps no longer provides sysctl.conf.
(My opinion for this one: sysctl.conf doesn't logically belong to 
base-files.)

Solution 3:
Let systemd provide a broken symlink '/etc/sysctl.d/99-sysctl.conf' and 
don't change anything else.

Which of the above three solutions do you like? Do you have any other 
suggestion?

//Chen Qi



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] systemd: make /etc/sysctl.conf have real effect
  2014-11-07  3:34               ` ChenQi
@ 2014-11-07 14:29                 ` Martin Jansa
  2014-11-09  7:06                   ` ChenQi
  0 siblings, 1 reply; 11+ messages in thread
From: Martin Jansa @ 2014-11-07 14:29 UTC (permalink / raw)
  To: ChenQi; +Cc: Koen Kooi, openembedded-core

[-- Attachment #1: Type: text/plain, Size: 5334 bytes --]

On Fri, Nov 07, 2014 at 11:34:47AM +0800, ChenQi wrote:
> On 11/07/2014 06:38 AM, Randy Witt wrote:
> > On 11/06/2014 05:29 AM, Koen Kooi wrote:
> >>
> >> Op 6 nov. 2014, om 12:59 heeft ChenQi <Qi.Chen@windriver.com> het 
> >> volgende geschreven:
> >>
> >>>
> >>>
> >>> On 11/06/2014 06:33 PM, Koen Kooi wrote:
> >>>>> Op 6 nov. 2014, om 08:59 heeft ChenQi <Qi.Chen@windriver.com> het 
> >>>>> volgende geschreven:
> >>>>>
> >>>>> On 11/06/2014 03:48 PM, Koen Kooi wrote:
> >>>>>> Op 6 nov. 2014, om 08:32 heeft Chen Qi <Qi.Chen@windriver.com> 
> >>>>>> het volgende geschreven:
> >>>>>>
> >>>>>>> In systemd, /etc/sysctl.conf is actually ignored by systemd-sysctl,
> >>>>>>> because this command only examine *.conf files under a bunch of 
> >>>>>>> directories
> >>>>>>> like /etc/sysctl.d or /usr/lib/sysctl.d.
> >>>>>>>
> >>>>>>> The problem is we are used to configuring kernel parameters in 
> >>>>>>> /etc/sysctl.conf,
> >>>>>>> so it would be really strange if the configuration in that file 
> >>>>>>> doesn't have any
> >>>>>>> effect.
> >>>>>>>
> >>>>>>> This patch reference Fedora's solution to this problem, creating 
> >>>>>>> a symlink to
> >>>>>>> /etc/sysctl.conf under /etc/sysctl.d/.
> >>>>>> Shouldn't this be done in procps instead?
> >>>>>>
> >>>>> Actually, the problem is not about `sysctl' command.
> >>>>> procps provides `sysctl', but busybox also provides this command.
> >>>>> It's very possible that on our generated image, procps is not 
> >>>>> installed but `sysctl' command is available.
> >>>>> Both busybox's and procps's `sysctl' command takes 
> >>>>> /etc/sysctl.conf into consideration.
> >>>> Right, but only procps installs that file.
> >>>
> >>> As busybox provides `sysctl' utility, is it reasonable that it also 
> >>> provides a corresponding configuration file (/etc/sysctl.conf)? 
> >>> Should we make a patch for busybox?
> >>>
> >>>
> >>>>> Now, systemd provides a similar utility called `systemd-sysctl' 
> >>>>> which is executed at boot time via systemd-sysctl.service.
> >>>>>
> >>>>> So our actually problem is that systemd-sysctl ignores 
> >>>>> /etc/sysctl.conf, which makes it somewhat strange, especially to 
> >>>>> users who are used to configuring parameters in sysctl.conf.
> >>>>> And this patch solves this problem by adding a symlink under 
> >>>>> /etc/sysctl.d/.
> >>>>>
> >>>>> That's why I think we should put this in systemd.
> >>>> You're adding a symlink to a file which only exists if you install 
> >>>> procps, which isn't in RDEPENDS.
> >>>>
> >>>
> >>> As I said before, procps is *not* necessary for the sysctl mechanism 
> >>> to have effect.
> >>> (Think about systemd-based core-image-minimal image.)
> >>>
> >>> Busybox provides `sysctl', systemd provides `systemd-sysctl'.
> >>> (It's an easy program, there might exist other packages that provide 
> >>> it too.)
> >>>
> >>> /etc/sysctl.conf is a configuration file which is very likely to be 
> >>> modified or created by administrators to configure kernel parameters.
> >>> (You can't expect administrators to all start learning systemd, 
> >>> trying to understand the gap and differences. In addition, they may 
> >>> have scripts that edit /etc/sysctl.conf to automate their work.)
> >>>
> >>> The point of the symlink is to ensure that when users edit 
> >>> /etc/sysctl.conf (or create one), configurations in that file will 
> >>> have effect at boot time.
> >>>
> >>> Just think about this problem from a standpoint of user experience.
> >>
> >> You still haven't convinced me that shipping a broken symlink is a 
> >> good idea. I'm pretty sure it's not even allowed in out commit 
> >> guidelines.
> >>
> > I agree, even in Fedora's case, both /etc/sysctl.conf and 
> > /etc/sysctl.d/99-sysctl.conf come from the same package, 
> > initscripts-9.51-2.
> >
> >
> 
> Koen & Witt,
> 
> When I started out to solve this problem, I basically came up with three 
> solutions. Please see details below. I chose to use solution 3 because I 
> think it's better than the other two. Please tell me which one you like, 
> or please tell me your solution.
> 
> Solution 1:
> Make 'sysctl.conf' managed by ALTERNATIVES mechanism in OE. Busybox, 
> procps and systemd all provide this file. And the symlink is still in 
> systemd.
> (My opinion for this one: over engineering)
> 
> Solution 2:
> Make base-files provide sysctl.conf and /etc/sysctl.d/99-sysctl.conf (in 
> case of systemd). procps no longer provides sysctl.conf.
> (My opinion for this one: sysctl.conf doesn't logically belong to 
> base-files.)
> 
> Solution 3:
> Let systemd provide a broken symlink '/etc/sysctl.d/99-sysctl.conf' and 
> don't change anything else.
> 
> Which of the above three solutions do you like? Do you have any other 
> suggestion?

Solution 4 (suggested by Koen and supported by me):
Provide the systemd symlink by the same package which provides sysctl.conf in
your image.

If you want to get better user experience for admins with scripts to
update their /etc/sysctl.conf then submit patch to systemd upstream to
process that file, so that their experience will be the same on all
systemd based systems they manage.

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] systemd: make /etc/sysctl.conf have real effect
  2014-11-07 14:29                 ` Martin Jansa
@ 2014-11-09  7:06                   ` ChenQi
  0 siblings, 0 replies; 11+ messages in thread
From: ChenQi @ 2014-11-09  7:06 UTC (permalink / raw)
  To: Martin Jansa; +Cc: Koen Kooi, openembedded-core

Martin & Koen,

I've sent out a new patch.
The title is '[OE-core] [PATCH 0/1] procps: install symlink under 
/etc/sysctl.d in case of systemd'.

Thanks for your reviewing.

Best Regards,
Chen Qi

On 11/07/2014 10:29 PM, Martin Jansa wrote:
> On Fri, Nov 07, 2014 at 11:34:47AM +0800, ChenQi wrote:
>> On 11/07/2014 06:38 AM, Randy Witt wrote:
>>> On 11/06/2014 05:29 AM, Koen Kooi wrote:
>>>> Op 6 nov. 2014, om 12:59 heeft ChenQi <Qi.Chen@windriver.com> het
>>>> volgende geschreven:
>>>>
>>>>>
>>>>> On 11/06/2014 06:33 PM, Koen Kooi wrote:
>>>>>>> Op 6 nov. 2014, om 08:59 heeft ChenQi <Qi.Chen@windriver.com> het
>>>>>>> volgende geschreven:
>>>>>>>
>>>>>>> On 11/06/2014 03:48 PM, Koen Kooi wrote:
>>>>>>>> Op 6 nov. 2014, om 08:32 heeft Chen Qi <Qi.Chen@windriver.com>
>>>>>>>> het volgende geschreven:
>>>>>>>>
>>>>>>>>> In systemd, /etc/sysctl.conf is actually ignored by systemd-sysctl,
>>>>>>>>> because this command only examine *.conf files under a bunch of
>>>>>>>>> directories
>>>>>>>>> like /etc/sysctl.d or /usr/lib/sysctl.d.
>>>>>>>>>
>>>>>>>>> The problem is we are used to configuring kernel parameters in
>>>>>>>>> /etc/sysctl.conf,
>>>>>>>>> so it would be really strange if the configuration in that file
>>>>>>>>> doesn't have any
>>>>>>>>> effect.
>>>>>>>>>
>>>>>>>>> This patch reference Fedora's solution to this problem, creating
>>>>>>>>> a symlink to
>>>>>>>>> /etc/sysctl.conf under /etc/sysctl.d/.
>>>>>>>> Shouldn't this be done in procps instead?
>>>>>>>>
>>>>>>> Actually, the problem is not about `sysctl' command.
>>>>>>> procps provides `sysctl', but busybox also provides this command.
>>>>>>> It's very possible that on our generated image, procps is not
>>>>>>> installed but `sysctl' command is available.
>>>>>>> Both busybox's and procps's `sysctl' command takes
>>>>>>> /etc/sysctl.conf into consideration.
>>>>>> Right, but only procps installs that file.
>>>>> As busybox provides `sysctl' utility, is it reasonable that it also
>>>>> provides a corresponding configuration file (/etc/sysctl.conf)?
>>>>> Should we make a patch for busybox?
>>>>>
>>>>>
>>>>>>> Now, systemd provides a similar utility called `systemd-sysctl'
>>>>>>> which is executed at boot time via systemd-sysctl.service.
>>>>>>>
>>>>>>> So our actually problem is that systemd-sysctl ignores
>>>>>>> /etc/sysctl.conf, which makes it somewhat strange, especially to
>>>>>>> users who are used to configuring parameters in sysctl.conf.
>>>>>>> And this patch solves this problem by adding a symlink under
>>>>>>> /etc/sysctl.d/.
>>>>>>>
>>>>>>> That's why I think we should put this in systemd.
>>>>>> You're adding a symlink to a file which only exists if you install
>>>>>> procps, which isn't in RDEPENDS.
>>>>>>
>>>>> As I said before, procps is *not* necessary for the sysctl mechanism
>>>>> to have effect.
>>>>> (Think about systemd-based core-image-minimal image.)
>>>>>
>>>>> Busybox provides `sysctl', systemd provides `systemd-sysctl'.
>>>>> (It's an easy program, there might exist other packages that provide
>>>>> it too.)
>>>>>
>>>>> /etc/sysctl.conf is a configuration file which is very likely to be
>>>>> modified or created by administrators to configure kernel parameters.
>>>>> (You can't expect administrators to all start learning systemd,
>>>>> trying to understand the gap and differences. In addition, they may
>>>>> have scripts that edit /etc/sysctl.conf to automate their work.)
>>>>>
>>>>> The point of the symlink is to ensure that when users edit
>>>>> /etc/sysctl.conf (or create one), configurations in that file will
>>>>> have effect at boot time.
>>>>>
>>>>> Just think about this problem from a standpoint of user experience.
>>>> You still haven't convinced me that shipping a broken symlink is a
>>>> good idea. I'm pretty sure it's not even allowed in out commit
>>>> guidelines.
>>>>
>>> I agree, even in Fedora's case, both /etc/sysctl.conf and
>>> /etc/sysctl.d/99-sysctl.conf come from the same package,
>>> initscripts-9.51-2.
>>>
>>>
>> Koen & Witt,
>>
>> When I started out to solve this problem, I basically came up with three
>> solutions. Please see details below. I chose to use solution 3 because I
>> think it's better than the other two. Please tell me which one you like,
>> or please tell me your solution.
>>
>> Solution 1:
>> Make 'sysctl.conf' managed by ALTERNATIVES mechanism in OE. Busybox,
>> procps and systemd all provide this file. And the symlink is still in
>> systemd.
>> (My opinion for this one: over engineering)
>>
>> Solution 2:
>> Make base-files provide sysctl.conf and /etc/sysctl.d/99-sysctl.conf (in
>> case of systemd). procps no longer provides sysctl.conf.
>> (My opinion for this one: sysctl.conf doesn't logically belong to
>> base-files.)
>>
>> Solution 3:
>> Let systemd provide a broken symlink '/etc/sysctl.d/99-sysctl.conf' and
>> don't change anything else.
>>
>> Which of the above three solutions do you like? Do you have any other
>> suggestion?
> Solution 4 (suggested by Koen and supported by me):
> Provide the systemd symlink by the same package which provides sysctl.conf in
> your image.
>
> If you want to get better user experience for admins with scripts to
> update their /etc/sysctl.conf then submit patch to systemd upstream to
> process that file, so that their experience will be the same on all
> systemd based systems they manage.
>



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-11-09  7:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-06  7:32 [PATCH 0/1] systemd: make /etc/sysctl.conf have real effect Chen Qi
2014-11-06  7:32 ` [PATCH 1/1] " Chen Qi
2014-11-06  7:48   ` Koen Kooi
2014-11-06  7:59     ` ChenQi
2014-11-06 10:33       ` Koen Kooi
2014-11-06 11:59         ` ChenQi
2014-11-06 13:29           ` Koen Kooi
2014-11-06 22:38             ` Randy Witt
2014-11-07  3:34               ` ChenQi
2014-11-07 14:29                 ` Martin Jansa
2014-11-09  7:06                   ` ChenQi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox