开发者

check current directory listing when system is ran out of process table?

开发者 https://www.devze.com 2023-01-31 01:35 出处:网络
t开发者_运维问答hat simple..but how?You\'ll be limited to shell built-ins, so if you\'re running bash, type help and examine the built-ins available.

t开发者_运维问答hat simple..but how?


You'll be limited to shell built-ins, so if you're running bash, type help and examine the built-ins available.

For example, you should be able to do

$ echo *

to list the filenames in the current directory.

Assuming you want to try and recover the system after looking at the current directory, there are a number of options available to you.

Importantly, kill(1) is built-in, so you can use that to free up process slots.

You can navigate /proc to examine the running processes - /proc/<pid>/cmdline will contain the process names which you can read directly in the shell:

$ read line < /proc/self/cmdline
$ echo $line

That may help find which process IDs you need to kill.


You mean you've run out of available PID's?

Most shells list the current directory with a built-in, rather than by invoking the ls binary so you shouldn't expend a pid.

That said I'd probably just kill 100 or so pids at random to give myself some breathing room with which to fix whatever went wrong.

0

精彩评论

暂无评论...
验证码 换一张
取 消