Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grep -L return value breaks network start #300

Closed
dirteat opened this issue Jan 20, 2020 · 3 comments
Closed

grep -L return value breaks network start #300

dirteat opened this issue Jan 20, 2020 · 3 comments
Assignees

Comments

@dirteat
Copy link

dirteat commented Jan 20, 2020

Spotted by M. W. on Mageia:

  • Noteworthy changes in release 3.2 (2018-12-20) [stable]
    ** Changes in behavior
    The --files-without-match (-L) option now causes grep to succeed
    when a file is listed, instead of when a line is selected. This
    resembles what git-grep does.

This breaks the init.d/network scripts there:

if LANG=C grep -EL "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ifcfg-$i > /dev/null ;
then
# this loads the module, to preserve ordering
is_available $i
continue
fi

and just after for the # Bring up xDSL and VPN interfaces.

The fix is to either use a negation, or the negated option -l

Cheers,
Chris.

@lnykryn
Copy link
Member

lnykryn commented Jan 20, 2020

I would suggest replacing this with something like
if ( . ./ifcfg-$i ; is_false $ONBOOT ; ) ; then ....
Using standard is_true/is_false function but sourcing the ifcfg file in the subshell, so we don't mess up the current environment.

@lnykryn lnykryn assigned lnykryn and jamacku and unassigned lnykryn Jan 20, 2020
@jamacku jamacku added the bug label Jan 24, 2020
jamacku added a commit to jamacku/initscripts that referenced this issue Jan 24, 2020
jamacku added a commit to jamacku/initscripts that referenced this issue Jan 24, 2020
jamacku added a commit to jamacku/initscripts that referenced this issue Jan 24, 2020
jamacku added a commit to jamacku/initscripts that referenced this issue Jan 24, 2020
@jamacku
Copy link
Member

jamacku commented Jan 24, 2020

Hi,
Pull request #301 should fix your issue. In case It won't, please let me know.

jamacku added a commit to jamacku/initscripts that referenced this issue Jan 27, 2020
@jamacku jamacku added the patch label Feb 21, 2020
jamacku added a commit to jamacku/initscripts that referenced this issue Mar 10, 2020
lnykryn pushed a commit that referenced this issue Mar 24, 2020
jamacku added a commit to jamacku/initscripts that referenced this issue Apr 16, 2020
Sugested by @lnykryn
Related to issue fedora-sysv#300

(cherry picked from commit 55ee446)
jamacku added a commit to jamacku/initscripts that referenced this issue Apr 16, 2020
Sugested by @lnykryn
Related to issue fedora-sysv#300

(cherry picked from commit 04bb81e)
jamacku added a commit to jamacku/initscripts that referenced this issue Apr 16, 2020
Option -L is not supported in grep 3.2+
Related to #rhbz1824324

-----------

Sugested by @lnykryn
Related to issue fedora-sysv#300

(cherry picked from commit 04bb81e)
jamacku added a commit that referenced this issue Jun 16, 2020
Option -L is not supported in grep 3.2+
Related to #rhbz1824324

-----------

Sugested by @lnykryn
Related to issue #300

(cherry picked from commit 04bb81e)
@jamacku
Copy link
Member

jamacku commented Jun 18, 2020

Fixed in initscripts 10.03

@jamacku jamacku closed this as completed Jun 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants