User can't get propmt runing cat command and ps -ef command in RHEL 7.5

Latest response

Hi All,

I have install new VM .Now i have tried to get the output using cat command ,server gets hang and am not able to get back the prompt .
But the same time i can run the same command in console and getting output.

Kanna@Lab$ cat /etc/passwd


Hi Kannabiran,

a) Can you please try to find out what is holding the execution:

$ strace cat /etc/passwd

b) Also, check the processes (full ps command) which are in D state. Observing D tends to indicate a slow I/O (network file system), something wrong in the kernel, or something wrong with the hardware.


Dusan Baljevic (amateur radio VK2COT)

Thank you Dusan,

Please find the output.

Kanna@Labl$ strace cat /etc/passwd execve("/usr/bin/cat", ["cat", "/etc/passwd"], [/* 22 vars */]) = 0 brk(NULL) = 0x237a000 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fe7aa956000 access("/etc/", R_OK) = -1 ENOENT (No such file or directory) open("/etc/", O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=48664, ...}) = 0

we didn't get back the prompt and Ctrl+c ,Ctrl+d ,Ctrl+z ...also not accepting.

Hi Kannabiran,

YOur trace is very short.

Normally, I would expect mmap to follow the fstat. Something like this

open("/etc/", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=67438, ...}) = 0
mmap(NULL, 67438, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f4143fae000

Did you get results of ps common from other window?

Otherwise, I think it might be a good idea to run sosreport, run soscleaner (if any data needs to be anonymized or sanitized), and open a case with Red Hat.


Dusan Baljevic (amateur radio VK2COT)

And one more idea.

Try this:

# yum -y reinstall systemd


Dusan Baljevic (amateur radio VK2COT)

... And check if /etc/ is corrupt:

# ldconfig -p

If you suspect some corruption, you can rebuild it:

# rm /etc/

# ldconfig


Dusan Baljevic (amateur radio VK2COT)

Does df -h hang too?

If so you may have a file system error on the root file system.