Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 503700 - /etc/init.d/sysctl (part of sys-apps/openrc-0.12.4) does not seem to properly check /etc/sysctl.d/*.conf
Summary: /etc/init.d/sysctl (part of sys-apps/openrc-0.12.4) does not seem to properly...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-07 08:16 UTC by Taahir Ahmed
Modified: 2014-07-05 19:55 UTC (History)
0 users

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 Taahir Ahmed 2014-03-07 08:16:43 UTC
/etc/init.d/sysctl contains the line

for conf in /etc/sysctl.conf /etc/sysctl.d/*.conf; do

When I insert "echo "Checking $conf" on the line below it, I get the two lines of output:

Checking /etc/sysctl.conf
Checking /etc/sysctl.d/*.conf

The wildcard doesn't seem to get expanded.  Expansion doesn't seem to happen in the subsequent calls to sysctly.

Changing the loop to:

for conf in /etc/sysctl.conf /etc/sysctl.d/*.conf; do

results in expansion, though obviously not only over the conf files.  An inner check using grep should accomplish that filtering.

Alternatively, find could be used for the iteration.

Reproducible: Always
Comment 1 Gilles OLIVIER 2014-04-20 14:46:04 UTC
indeed, which explains the merits of the line :

if [ -r "$conf" ]; then

when the /etc/sysctl.d directory contains no .conf file especially


Perhaps would you want that to be used :

 shopt -s/-u nullglob

but this is not the choice made
Comment 2 William Hubbs gentoo-dev 2014-07-05 13:41:19 UTC
(In reply to Taahir Ahmed from comment #0)
> /etc/init.d/sysctl contains the line
> 
> for conf in /etc/sysctl.conf /etc/sysctl.d/*.conf; do

*snip*

> Changing the loop to:
> 
> for conf in /etc/sysctl.conf /etc/sysctl.d/*.conf; do

Where is the change? These two lines appear to be the same to me.

Also, if you run the script in verbose mode by typing:

/etc/init.d/sysctl --verbose start

you should see that all of the conf files are processed.

I am unable to reproduce this. If you have more information, please let me know.

Thanks,

William
Comment 3 Taahir Ahmed 2014-07-05 19:55:01 UTC
I can no longer reproduce this issue either.

I'm not sure what the issue was -- perhaps it was just a misunderstanding on my part.

As for my suggested change, I mistyped it.  I meant to put:

for conf in /etc/sysctl.conf /etc/sysctl./* ; do