Why "sysctl: cannot stat /proc/sys/kernel/<parameter>: No such file or directory" messages occurred?

Solution Verified - Updated -

Environment

  • RedHat Enterprise Linux 8

Issue

  • Why "sysctl: cannot stat /proc/sys/kernel/
    : No such file or directory" messages occurred?
  • After adding kernel parameter value, we got below messages.
sysctl: cannot stat /proc/sys/kernel/shmall : No such file or directory
sysctl: cannot stat /proc/sys/kernel/shmmax : No such file or directory

Resolution

  • Do not copy and paste from other system but wrote the parameter and value manually.
  • Or, copy through same editor in the system. (Such as VI or VIM)

Root Cause

  • Copy from other editor (Such as in Window system), unexpected ascii code can be included.
  • You can check it via xxd command result.
kernel.shmall�| =�| 16388066
kernel.shmmax�| =�| 67125518336

- customer's sysctl.conf results of xxd

$ grep -E shmall etc/sysctl.conf > ~/tmp/h
kernel.shmall = 16388066
$ xxd ~/tmp/h                             vv vvvv
00000000: 6b65 726e 656c 2e73 686d 616c 6cc2 a03d  kernel.shmall..=
00000010: c2a0 3136 3338 3830 3636 0a              ..16388066.

- in my system
$ grep -E shmall etc/sysctl.conf > ~/tmp/h
kernel.shmall = 16388066
$ xxd ~/tmp/h                             vv vvvv
0000000: 6b65 726e 656c 2e73 686d 616c 6c20 3d20  kernel.shmall =
0000010: 3136 3338 3830 3636 0a                   16388066.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments