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 1395050 - sysctl return 0 even fail to set value
Summary: sysctl return 0 even fail to set value
Keywords:
Status: CLOSED DUPLICATE of bug 1264080
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: procps-ng
Version: 7.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Jan Rybar
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-15 03:21 UTC by Jianlin Shi
Modified: 2016-11-29 14:28 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-29 14:28:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jianlin Shi 2016-11-15 03:21:02 UTC
Description of problem:
sysctl return 0 even fail to set value

Version-Release number of selected component (if applicable):
procps-ng-3.3.10-10.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1. sysctl  -w net.ipv4.ip_default_ttl=0
2. check return value

Actual results:
return value is 0

Expected results:
return value should be 255

Additional info:

[root@ibm-x3650m5-03 proc_sys_net_ipv4]# uname -a
Linux ibm-x3650m5-03.rhts.eng.pek2.redhat.com 3.10.0-514.el7.x86_64 #1 SMP Wed Oct 19 11:24:13 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux
[root@ibm-x3650m5-03 proc_sys_net_ipv4]# rpm -qa | grep procps
procps-ng-3.3.10-10.el7.x86_64
[root@ibm-x3650m5-03 proc_sys_net_ipv4]# sysctl  -w net.ipv4.ip_default_ttl=0
sysctl: setting key "net.ipv4.ip_default_ttl": Invalid argument
net.ipv4.ip_default_ttl = 0
[root@ibm-x3650m5-03 proc_sys_net_ipv4]# echo $?
0
[root@ibm-x3650m5-03 proc_sys_net_ipv4]# sysctl net.ipv4.ip_default_ttl
net.ipv4.ip_default_ttl = 64

Comment 1 Kamil Dudka 2016-11-15 09:16:59 UTC
(In reply to Jianlin Shi from comment #0)
> Steps to Reproduce:
> 1. sysctl  -w net.ipv4.ip_default_ttl=0
> 2. check return value
> 
> Actual results:
> return value is 0

This looks incorrect indeed.  The exit code should be non-zero if sysctl failed to write the value.

> Expected results:
> return value should be 255

Why do you think that exactly 255 should be returned?

Comment 2 Jianlin Shi 2016-11-15 09:26:50 UTC
(In reply to Kamil Dudka from comment #1)
> (In reply to Jianlin Shi from comment #0)
> > Steps to Reproduce:
> > 1. sysctl  -w net.ipv4.ip_default_ttl=0
> > 2. check return value
> > 
> > Actual results:
> > return value is 0
> 
> This looks incorrect indeed.  The exit code should be non-zero if sysctl
> failed to write the value.
> 
> > Expected results:
> > return value should be 255
> 
> Why do you think that exactly 255 should be returned?

program normally return 255 if the error is "Invalid argument". BTW, sysctl return 255 on rhel6.

Comment 3 Jan Rybar 2016-11-15 12:45:56 UTC
Issue reproduced and will be investigated.
Thank you for your report.

Comment 4 Jan Rybar 2016-11-29 14:28:05 UTC
Looks like duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=1264080

Closing as DUPLICATE

*** This bug has been marked as a duplicate of bug 1264080 ***


Note You need to log in before you can comment on or make changes to this bug.