Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 541922

Summary: init.d/sysctl: Add --quiet
Product: Gentoo Hosted Projects Reporter: Mira Ressel <aranea>
Component: OpenRCAssignee: OpenRC Team <openrc>
Status: RESOLVED FIXED    
Severity: normal CC: whissi
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 520144    

Description Mira Ressel 2015-03-02 16:24:12 UTC
By default, sysctl prints all changed variables to stdout, thereby unneccessarily spamming the console. Please replace "sysctl --system" by "sysctl --quiet --system" in init.d/sysctl.Linux.in.

The other variants of the sysctl init script don't have this problem as they do a ">/dev/null". Also, please note that the order of the options is important; "sysctl --system --quiet" wouldn't have the desired effect.
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2015-03-02 18:10:28 UTC
Please take $rc_verbose for this into account, something like

--- /etc/init.d/sysctl.old      2015-03-02 19:03:44.506263213 +0100
+++ /etc/init.d/sysctl  2015-03-02 19:05:34.540650678 +0100
@@ -10,7 +10,10 @@

 start()
 {
+       local redirect
+       yesno $rc_verbose || redirect='> /dev/null 2>&1'
+
        ebegin "Configuring kernel parameters"
-       sysctl --system
+       eval sysctl --system ${redirect}
        eend $? "Unable to configure some kernel parameters"
 }
Comment 2 Thomas Deutschmann (RETIRED) gentoo-dev 2015-03-02 18:18:37 UTC
or with "--quiet" like Luis proposed:

--- /etc/init.d/sysctl.old      2015-03-02 19:03:44.506263213 +0100
+++ /etc/init.d/sysctl  2015-03-02 19:16:51.891968328 +0100
@@ -10,7 +10,10 @@

 start()
 {
+       local quiet=
+       yesno $rc_verbose || quiet="--quiet"
+
        ebegin "Configuring kernel parameters"
-       sysctl --system
+       eval sysctl ${quiet} --system
        eend $? "Unable to configure some kernel parameters"
 }
Comment 3 William Hubbs gentoo-dev 2015-04-03 16:21:53 UTC
https://github.com/OpenRC/openrc/pull/51