Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2052536

Summary: hyphen in /usr/lib/sysctl.d/50-default.conf invalid argument
Product: Red Hat Enterprise Linux 9 Reporter: bugzilla
Component: procps-ngAssignee: systemd-maint
Status: CLOSED ERRATA QA Contact: Karel Volný <kvolny>
Severity: medium Docs Contact: Šárka Jana <sjanderk>
Priority: unspecified    
Version: 9.0CC: dtardon, jpazdziora, jreznik, jrybar, msekleta, sjanderk, systemd-maint-list, zbyszek
Target Milestone: rcKeywords: FeatureBackport, Triaged, ZStream
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: procps-ng-3.3.17-6.el9 Doc Type: Enhancement
Doc Text:
.`sysctl` introduces identic syntax for arguments as `systemd-sysctl` The `sysctl` utility from the `procps-ng` package, which you can use to modify kernel parameters at runtime, now uses the same syntax for arguments as the `systemd-sysctl` utility. With this update, `sysctl` now parses configuration files that contain hyphens (`-`) or globs (`*`) on configuration lines. For more information about the `systemd-sysctl` syntax, see the `sysctl.d(5)` man page.
Story Points: ---
Clone Of:
: 2121090 (view as bug list) Environment:
Last Closed: 2022-11-15 11:12:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2121090    

Description bugzilla 2022-02-09 14:09:31 UTC
Description of problem:

the leading minus/hyphen in /usr/lib/sysctl.d/50-default.conf and 50-redhat.conf cause "Invalid argument" errors.

Version-Release number of selected component (if applicable):

RHEL 9.0 beta

procps-ng-3.3.17-4.el9.x86_64

How reproducible:

100%

Steps to Reproduce:
1. Run systemctl --system

Actual results:

# sysctl --system |grep Invalid
sysctl: setting key "net.ipv4.conf.all.rp_filter": Invalid argument
sysctl: setting key "net.ipv4.conf.all.accept_source_route": Invalid argument
sysctl: setting key "net.ipv4.conf.all.promote_secondaries": Invalid argument
sysctl: setting key "net.ipv4.conf.all.rp_filter": Invalid argument

Expected results:

Keys are set

Additional info:

I assume the packager believes the minus is a comment, as the offending keys have no value, so wouldn't work even if the hyphen was removed:

# egrep '^-' /usr/lib/sysctl.d/*
/usr/lib/sysctl.d/50-default.conf:-net.ipv4.conf.all.rp_filter
/usr/lib/sysctl.d/50-default.conf:-net.ipv4.conf.all.accept_source_route
/usr/lib/sysctl.d/50-default.conf:-net.ipv4.conf.all.promote_secondaries
/usr/lib/sysctl.d/50-default.conf:-net.ipv4.ping_group_range = 0 2147483647
/usr/lib/sysctl.d/50-default.conf:-net.core.default_qdisc = fq_codel
/usr/lib/sysctl.d/50-redhat.conf:-net.ipv4.conf.all.rp_filter

Comment 1 bugzilla 2022-03-23 11:50:36 UTC
any update, still not fixed as of today despite a major systemd version uplift

"dnf whatprovides" on those files returns systemd and redhat-release, so not sure where i got procps-ng from!

Comment 3 Zbigniew Jędrzejewski-Szmek 2022-03-31 13:06:26 UTC
"-" is a prefix used by systemd-sysctl for keys for which a warning should not be emitted.
sysctl from procps-ng does not understand this syntax, so it warns.
I think support for it was added in later versions of procps-ng, but I'm not sure if/when.

In general, there is no need to call sysctl. Just use systemd-sysctl.

Comment 4 David Tardon 2022-03-31 13:17:10 UTC
(In reply to Zbigniew Jędrzejewski-Szmek from comment #3)
> sysctl from procps-ng does not understand this syntax, so it warns.
> I think support for it was added in later versions of procps-ng, but I'm not
> sure if/when.

I already linked the relevant procps-ng issue when I switched this bug to procps-ng. But as it seems that hasn't been enough, I'll repeat it in a comment too: https://gitlab.com/procps-ng/procps/-/issues/191 . And here's the commit that implements the change: https://gitlab.com/procps-ng/procps/-/commit/474847ed35dda5fd4c33a717d8cc7c4d17b90232 .

Comment 17 errata-xmlrpc 2022-11-15 11:12:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (procps-ng bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:8276