You are not logged in.

#1 2021-01-19 15:35:39

georgedeming
Member
Registered: 2021-01-14
Posts: 6

[SOLVED]Cannot cat /proc/sys/kernel/pid_max

"Cannot allocate memory"

I tried on centos and get result but arch cannot.

What should I do?

Last edited by georgedeming (2021-01-19 16:07:31)

Offline

#2 2021-01-19 15:36:49

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,525
Website

Re: [SOLVED]Cannot cat /proc/sys/kernel/pid_max

How about stat /proc/sys/kernel/pid_max?  I assume you don't have issues cat'ing other files, right?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2021-01-19 15:41:56

georgedeming
Member
Registered: 2021-01-14
Posts: 6

Re: [SOLVED]Cannot cat /proc/sys/kernel/pid_max

Trilby wrote:

How about stat /proc/sys/kernel/pid_max?  I assume you don't have issues cat'ing other files, right?

`stat /proc/sys/kernel/pid_max`:
    File: ‘/proc/sys/kernel/pid_max’
    Size: 0               Blocks: 0          IO Block: 1024   regular empty file
    Device: 3h/3d   Inode: 12816       Links: 1
    Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
    Access: 2021-01-08 20:13:32.783066468 +0800
    Modify: 2021-01-08 20:13:32.783066468 +0800
    Change: 2021-01-08 20:13:32.783066468 +0800
    Birth: -

Files in /proc cannot cat, others cat is ok.

Offline

#4 2021-01-19 15:44:02

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,525
Website

Re: [SOLVED]Cannot cat /proc/sys/kernel/pid_max

No files in /proc can be cat'ed?  E.g., `cat /proc/cmdline` fails?  Does it give the same error as pid_max?

If so, you should edit your title as this wouldn't have anything to do with the specific pid_max (psuedo-)file but rather there's a problem with your entire procfs (or memory ... but given you are not reporting other major issues, you are not likely actually our of memory).

Has the problem persisted through a reboot?  Please post a link to your journal for the current boot.

While were at it, please post the output of each of the following in [ code ] tags:

findmnt /proc
pacman -Q linux
uname -a
free -m
ulimit -a

Also, what led you to want to check pid_max?  Do you have reason to be concerned that you have exhausted the available pids?  This background might also explain the actual issue.

Last edited by Trilby (2021-01-19 15:50:39)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2021-01-19 15:53:46

georgedeming
Member
Registered: 2021-01-14
Posts: 6

Re: [SOLVED]Cannot cat /proc/sys/kernel/pid_max

Trilby wrote:

No files in /proc can be cat'ed?  E.g., `cat /proc/cmdline` fails?  Does it give the same error as pid_max?

If so, you should edit your title as this wouldn't have anything to do with the specific pid_max (psuedo-)file but rather there's a problem with your entire procfs (or memory ... but given you are not reporting other major issues, you are not likely actually our of memory).

Has the problem persisted through a reboot?  Please post a link to your journal for the current boot.

While were at it, please post the output of each of the following in [ code ] tags:

findmnt /proc
pacman -Q linux
uname -a
free -m
ulimit -a

oh, sorry, precisely, kernel/* , kernel/threads-max cannot read also.

`findmnt /proc`:
    TARGET SOURCE FSTYPE OPTIONS
    /proc  proc   proc   rw,nosuid,nodev,noexec,relatime
`uname -a`:
    Linux arch 5.10.6-arch1-1 #1 SMP PREEMPT Sat, 09 Jan 2021 18:22:35 +0000 x86_64 GNU/Linux
`free -m`:
              total        used        free      shared  buff/cache   available
    Mem:           7826        2677        1471        2609        3677        2270
    Swap:          1489         974         515
`ulimit -a`:
real-time non-blocking time  (microseconds, -R) unlimited
core file size              (blocks, -c) unlimited
data seg size               (kbytes, -d) unlimited
scheduling priority                 (-e) 0
file size                   (blocks, -f) unlimited
pending signals                     (-i) 31236
max locked memory           (kbytes, -l) 64
max memory size             (kbytes, -m) unlimited
open files                          (-n) 1024
pipe size                (512 bytes, -p) 8
POSIX message queues         (bytes, -q) 819200
real-time priority                  (-r) 0
stack size                  (kbytes, -s) 8192
cpu time                   (seconds, -t) unlimited
max user processes                  (-u) 31236
virtual memory              (kbytes, -v) unlimited
file locks                          (-x) unlimited

Last edited by georgedeming (2021-01-19 15:55:30)

Offline

#6 2021-01-19 16:02:45

seth
Member
Registered: 2012-09-03
Posts: 51,165

Re: [SOLVED]Cannot cat /proc/sys/kernel/pid_max

type cat

Offline

#7 2021-01-19 16:06:16

georgedeming
Member
Registered: 2021-01-14
Posts: 6

Re: [SOLVED]Cannot cat /proc/sys/kernel/pid_max

seth wrote:
type cat

cat is hashed (/usr/bin/cat)

Thanks !!!

Last edited by georgedeming (2021-01-19 16:07:17)

Offline

#8 2021-01-19 17:38:58

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,525
Website

Re: [SOLVED]Cannot cat /proc/sys/kernel/pid_max

Ah ... this is solved?  How?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB