saltstack / saltstack/salt

[BUG] sysctl.present fails on Photon OS 5

Open
#66,345 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-triage
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
sysctl.present state returns failure on Photon OS despite actually performing changes

Setup
Example state:

net.ipv4.conf.all.accept_redirects:
  sysctl.present:
    - value: 1

salt's return:

          ID: net.ipv4.conf.all.accept_redirects
    Function: sysctl.present
      Result: False
     Comment: Failed to set net.ipv4.conf.all.accept_redirects to 1: sysctl -w failed: /proc/sys/net/ipv4/conf/all/accept_redirects = 1
     Started: 00:06:18.297553
    Duration: 1.782 ms
     Changes:

99-salt.conf:

[root@astr-photon-01] ~ # tail -n 1 /etc/sysctl.d/99-salt.conf
net.ipv4.conf.all.accept_redirects = 1

Excerpt from the log:

[INFO    ] Running state [net.ipv4.conf.all.accept_redirects] at time 00:12:26.530794
[INFO    ] Executing state sysctl.present for [net.ipv4.conf.all.accept_redirects]
[INFO    ] Executing command /sbin/sysctl in directory '/root'
[DEBUG   ] stdout: 0
[DEBUG   ] output: 0
[INFO    ] Executing command /sbin/sysctl in directory '/root'
[DEBUG   ] stdout: /proc/sys/net/ipv4/conf/all/accept_redirects = 1
[ERROR   ] Failed to set net.ipv4.conf.all.accept_redirects to 1: sysctl -w failed: /proc/sys/net/ipv4/conf/all/accept_redirects = 1
[INFO    ] Completed state [net.ipv4.conf.all.accept_redirects] at time 00:12:26.533394 (duration_in_ms=2.599)
  • on-prem machine
  • VM (ESXi)
  • onedir packaging
  • used bootstrap to install

Expected behavior
Salt successfully setting sysctl value and reporting it as a success.

Versions Report Minion: Salt Version: Salt: 3007.0

Python Version:
Python: 3.10.13 (main, Feb 19 2024, 03:31:20) [GCC 11.2.0]

Dependency Versions:
cffi: 1.16.0
cherrypy: 18.8.0
dateutil: 2.8.2
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 3.1.3
libgit2: Not Installed
looseversion: 1.3.0
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 1.0.7
msgpack-pure: Not Installed
mysql-python: Not Installed
packaging: 23.1
pycparser: 2.21
pycrypto: Not Installed
pycryptodome: 3.19.1
pygit2: Not Installed
python-gnupg: 0.5.2
PyYAML: 6.0.1
PyZMQ: 25.1.2
relenv: 0.15.1
smmap: Not Installed
timelib: 0.3.0
Tornado: 6.3.3
ZMQ: 4.3.4

Salt Package Information:
Package Type: onedir

System Versions:
dist: photon 5.0 Photon
locale: utf-8
machine: x86_64
release: 6.1.81-4.ph5-esx
system: Linux
version: VMware Photon OS 5.0 Photon

Master:
Salt Version:
Salt: 3007.0

Python Version:
Python: 3.10.13 (main, Feb 19 2024, 03:31:20) [GCC 11.2.0]

Dependency Versions:
cffi: 1.16.0
cherrypy: unknown
dateutil: 2.8.2
docker-py: 7.0.0
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 3.1.3
libgit2: Not Installed
looseversion: 1.3.0
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 1.0.7
msgpack-pure: Not Installed
mysql-python: Not Installed
packaging: 23.2
pycparser: 2.21
pycrypto: Not Installed
pycryptodome: 3.19.1
pygit2: Not Installed
python-gnupg: 0.5.2
PyYAML: 6.0.1
PyZMQ: 25.1.2
relenv: 0.15.1
smmap: Not Installed
timelib: 0.3.0
Tornado: 6.3.3
ZMQ: 4.3.4

Salt Package Information:
Package Type: onedir

System Versions:
dist: ubuntu 22.04.4 jammy
locale: utf-8
machine: x86_64
release: 5.15.0-101-generic
system: Linux
version: Ubuntu 22.04.4 jammy

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Salt's sysctl.present state and compare its handling of the logged /sbin/sysctl -w output on Photon OS 5. Reproduce the provided state and verify that a successfully written value is reported as success, with regression coverage for the shown behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, python
Domain
devops, infrastructure, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.