-1

I have a weird problem where the rpm command hangs for 40 seconds (it's always exactly 40 seconds) when executed as any non-root user. It doesn't matter what command line arguments are used, even "rpm" without any arguments hangs (rpm --help is the only exception).

strace shows that it hangs on a select() call with two file descriptors pointing to /etc/passwd and /etc/pam.d/other, which doesn't make any sense to me.

When executed as root it completes immediately.

The system is RHEL 7, I observed the issue on two completely different machines in different customer environments.

I'm looking for a solution or some hints where to continue the investigation.

wojciech_k
  • 89
  • 1
  • 1
  • 3

2 Answers2

0

Seems like a DNS resolution problem. Hard to say what is the precise cause and there is no general log relating to DNS queries and their errors/results.

  • Check /etc/nsswitch.conf
  • Check /etc/resolv.conf
  • Check some host queries to point you in the right direction:

    host localhost

    host localhost.localdomain

    hostname

    host $(hostname)

    hostname -s

    host $(hostname -s)

    hostname -f

    host $(hostname -f)

kubanczyk
  • 13,812
  • 5
  • 41
  • 55
  • I don't have access to the machine right now, so I didn't try your suggestions yet, but I doubt it's DNS. If any DNS requests were made the operation of opening an UDP socket to port 53 would be visible in the strace output - but it isn't. – wojciech_k Mar 03 '16 at 07:45
0

Turned out the issue was caused by incorrect permissions on /etc/hosts. Changing them to 644 resolved the problem.

wojciech_k
  • 89
  • 1
  • 1
  • 3