Bug 498749 - sudo is SLOW when auth is cached
sudo is SLOW when auth is cached
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: sudo (Show other bugs)
11
All Linux
low Severity high
: ---
: ---
Assigned To: Daniel Kopeček
Fedora Extras Quality Assurance
:
: 519084 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-02 14:15 EDT by Bruno Antunes
Modified: 2009-08-25 05:59 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-08-20 07:24:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
strace.log (94.94 KB, application/octet-stream)
2009-05-26 07:18 EDT, Tommaso Visconti
no flags Details

  None (edit)
Description Bruno Antunes 2009-05-02 14:15:03 EDT
Description of problem:
running anything with sudo auth cached is slow!

Version-Release number of selected component (if applicable):
Rawhide (installed Preview CD to disc)

How reproducible:
run anything with sudo for the second time (so it doesn't ask for a password) like sudo vim /etc/ddclient.conf

Steps to Reproduce:
1. uncomment the "%wheel	ALL=(ALL)	ALL" line in /etc/sudoers
2. add yourself to the wheel group (I used system-config-users as root)
3. run anything, like f.ex. sudo vim /etc/ddclient.conf
4. enter your password
5. now exit vi and use sudo to do "something else"
  
Actual results:
a 10 second wait

Expected results:
immediately run "something else"

Additional info:
how can I send you guys more useful debugging info? is this due to me changing the laptop's hostname to a dyndns one?
Comment 1 Daniel Kopeček 2009-05-12 08:39:59 EDT
Hi, could you please try the new build? (https://admin.fedoraproject.org/updates/sudo-1.7.1-1.fc11)
Comment 2 Bruno Antunes 2009-05-14 20:02:08 EDT
IT's still kinda slow... how can I more accurately help you debugging this?
Comment 3 Tommaso Visconti 2009-05-26 05:42:38 EDT
i confirm the issue: sudo is very slow, quite impossible to work with it
Comment 4 Daniel Kopeček 2009-05-26 06:27:18 EDT
Ok. The output of strace would be helpful. Here is the command:

# strace -u <user> -Tvxf -o strace.log sudo cmd

You'll have to run this command as root (or set +s on strace). Substitute <user> with the user name under which you want to run the "sudo cmd" part. It'll write the output into strace.log. Attach this file to this bug report please.
Comment 5 Tommaso Visconti 2009-05-26 07:18:22 EDT
Created attachment 345444 [details]
strace.log

the command is:
strace -u tommyblue -Tvxf -o strace.log sudo cat .bashrc
Comment 6 Daniel Kopeček 2009-05-26 08:22:29 EDT
(In reply to comment #5)
> Created an attachment (id=345444) [details]
> strace.log
> 
> the command is:
> strace -u tommyblue -Tvxf -o strace.log sudo cat .bashrc  

Thanks. Do you have a record with your hostname (nerina?) in /etc/hosts?

uname({sysname="Linux", nodename="nerina", release="2.6.29.3-155.fc11.i686.PAE", version="#1 SMP Wed May 20 17:31:09 EDT 2009", machine="i686"}) = 0 <0.000007>
...
...
socket(PF_INET, 0x802 /* SOCK_??? */, IPPROTO_IP) = 5 <0.000012>
connect(5, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("208.67.222.222")}, 28) = 0 <0.000013>
...
...
...
poll([{fd=5, events=POLLIN}], 1, 4887) = 0 (Timeout) <4.891569>
Comment 7 Tommaso Visconti 2009-05-26 09:13:47 EDT
no, this is /etc/hosts as created by the installer:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
Comment 8 Tommaso Visconti 2009-05-26 09:14:50 EDT
208.67.222.222 is the address of opendns, used by my router
Comment 9 Daniel Kopeček 2009-05-26 09:44:30 EDT
(In reply to comment #7)
> no, this is /etc/hosts as created by the installer:
> 
> 127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
> ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6  

But you've set "nerina" as your hostname, haven't you? If this is true then add a record for "nerina" into /etc/hosts and then try sudo again.
Comment 10 Tommaso Visconti 2009-05-26 10:43:37 EDT
with the hostname set, sudo seems to work faster. But why the hostname wasn't set in /etc/hosts? i typed it during the install, maybe a bug in anaconda?
Comment 11 Bug Zapper 2009-06-09 11:01:52 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 12 michael.mcconachie 2009-06-15 09:38:18 EDT
Yes by adding my hostname to /etc/hosts I reduced my wait from ~30-60 seconds to < ~1.5 seconds for sudo to execute.  Happy Happy joy joy.

So:

1.  Does a work around exist for DHCP users who would require change for each new IP to /etc/hosts?

I never had this issue before with any other version of Linux (including any other Fedora Core (X) installs.  

This is why I am adding to this bug report (498749) which appears to have been  closed/redirected above in comment 11....?

Thanks.
Comment 13 Daniel Kopeček 2009-06-15 09:54:23 EDT
(In reply to comment #12)
> 1.  Does a work around exist for DHCP users who would require change for each
> new IP to /etc/hosts?

It should be fine when using DHCP. I'm using DHCP on F10 (NetworkManager) and the records are there.

> This is why I am adding to this bug report (498749) which appears to have been 
> closed/redirected above in comment 11....?

This bug is still open. But I don't think that this is something that should be fixed in sudo. The hostname of your machine should be resolvable.
Comment 14 Daniel Kopeček 2009-08-25 05:59:37 EDT
*** Bug 519084 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.