-
Slow sudoing
I’ve been noticing that using sudo was taking an unusually long time to execute on my prgmr server—commands like sudo vim /tmp/foo would hang for 3-5 seconds before finally opening vim for editing. I assumed it was due to poor I/O in a shared environment, but it persisted for a while so I finally decided to investigate.
It turns out every time you use sudo, PAM tries to resolve your IP. There’s more detail in Redhat’s Bugzilla, bug #479464.
The solution is to add your hostname to /etc/hosts:
127.0.0.1 <HOSTNAME>.<DOMAIN> <ALIAS>