Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 541922 - init.d/sysctl: Add --quiet
Summary: init.d/sysctl: Add --quiet
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: openrc-0.14
  Show dependency tree
 
Reported: 2015-03-02 16:24 UTC by Mira Ressel
Modified: 2015-04-07 23:01 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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