4

I'm using Fedora 23, the same problem was on Fedora 22. Sudo takes ~20 seconds to start, it doing something for ~20 seconds then asks password.

Reboot solves this problem for a while. After a few hours the problem appear again.

Here is peace of strace output

 0.000022 write(7, "\1", 1)         = 1
 0.000038 rt_sigreturn({mask=[INT QUIT]}) = -1 EINTR (Interrupted system call)
 0.000026 --- SIGCONT {si_signo=SIGCONT, si_code=SI_KERNEL} ---
 0.000012 poll([{fd=11, events=POLLIN}], 1, 25000) = 0 (Timeout)
25.025434 sendmsg(11, {msg_name(0)=NULL, msg_iov(2)=[{"l\1\1\1\204\0\0\0\6\0\0\0\177\0\0\0\1\1o\0\25\0\0\0/org/fre"..., 144}, {"\177\0\0\0type='signal',sender='net.re"..., 132}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 276
 0.000378 sendmsg(11, {msg_name(0)=NULL, msg_iov(2)=[{"l\1\1\1\246\0\0\0\7\0\0\0\177\0\0\0\1\1o\0\25\0\0\0/org/fre"..., 144}, {"\241\0\0\0type='signal',sender='org.fr"..., 166}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 310
 0.000176 write(12, "\1\0\0\0\0\0\0\0", 8) = 8
 0.000109 close(11)                 = 0
 0.000121 close(12)                 = 0
 0.000090 getuid()                  = 1000

You can see that sendmsg takes too much time.

Can someone help me with this? I don't want to reboot my laptop every time this happen.

uname -a
Linux c0rp 4.4.9-300.fc23.x86_64

Link to strace http://pastebin.com/n5GWi9G1

Here is output from strace -f -v -s300 -o log sudo

8204  poll([{fd=11, events=POLLIN}], 1, -1) = 1 ([{fd=11, revents=POLLIN}])
8204  read(11, "AGREE_UNIX_FD\r\n", 2048) = 15
8204  poll([{fd=11, events=POLLOUT}], 1, -1) = 1 ([{fd=11, revents=POLLOUT}])
8204  sendto(11, "BEGIN\r\n", 7, MSG_NOSIGNAL, NULL, 0) = 7
8204  poll([{fd=11, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=11, revents=POLLOUT}])
8204  sendmsg(11, {msg_name(0)=NULL, msg_iov(2)=[{"l\1\0\1\0\0\0\0\1\0\0\0n\0\0\0\1\1o\0\25\0\0\0/org/freedesktop/DBus\0\0\0\6\1s\0\24\0\0\0org.freedesktop.DBus\0\0\0\0\2\1s\0\24\0\0\0org.fr
eedesktop.DBus\0\0\0\0\3\1s\0\5\0\0\0Hello\0\0\0", 128}, {"", 0}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 128
8204  poll([{fd=11, events=POLLIN}], 1, 25000) = 1 ([{fd=11, revents=POLLIN}])
8204  recvmsg(11, {msg_name(0)=NULL, msg_iov(1)=[{"l\2\1\1\v\0\0\0\1\0\0\0=\0\0\0\6\1s\0\6\0\0\0:1.491\0\0\5\1u\0\1\0\0\0\10\1g\0\1s\0\0\7\1s\0\24\0\0\0org.freedesktop.DBus\0\0\0\0\6\0\0\0:1
.491\0l\4\1\1\v\0\0\0\2\0\0\0\215\0\0\0\1\1o\0\25\0\0\0/org/freedesktop/DBus\0\0\0\2\1s\0\24\0\0\0org.freedesktop.DBus\0\0\0\0\3\1s\0\f\0\0\0NameAcquired\0\0\0\0\6\1s\0\6\0\0\0:1.491\0\0\10\
1g\0\1s\0\0\7\1s\0\24\0\0\0org.freedesktop.DBus\0\0\0\0\6\0\0\0:1.491\0", 2048}], msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_CMSG_CLOEXEC) = 262
8204  recvmsg(11, 0x7ffec28d88e0, MSG_CMSG_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
8204  eventfd2(0, EFD_CLOEXEC|EFD_NONBLOCK) = 12
8204  write(12, "\1\0\0\0\0\0\0\0", 8)  = 8
8204  fstat(11, {st_dev=makedev(0, 8), st_ino=3014822, st_mode=S_IFSOCK|0777, st_nlink=1, st_uid=0, st_gid=1000, st_blksize=4096, st_blocks=0, st_size=0, st_atime=0, st_mtime=0, st_ctime=0})
 = 0
8204  fcntl(11, F_GETFL)                = 0x802 (flags O_RDWR|O_NONBLOCK)
8204  write(12, "\1\0\0\0\0\0\0\0", 8)  = 8
8204  sendmsg(11, {msg_name(0)=NULL, msg_iov(2)=[{"l\1\1\1\204\0\0\0\2\0\0\0\177\0\0\0\1\1o\0\25\0\0\0/org/freedesktop/DBus\0\0\0\6\1s\0\24\0\0\0org.freedesktop.DBus\0\0\0\0\2\1s\0\24\0\0\0org.freedesktop.DBus\0\0\0\0\3\1s\0\10\0\0\0AddMatch\0\0\0\0\0\0\0\0\10\1g\0\1s\0\0", 144}, {"\177\0\0\0type='signal',sender='net.reactivated.Fprint',path='/net/reactivated/Fprint/Manager',interface='net.reactivated.Fprint.Manager'\0", 132}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 276
8204  sendmsg(11, {msg_name(0)=NULL, msg_iov(2)=[{"l\1\1\1\246\0\0\0\3\0\0\0\177\0\0\0\1\1o\0\25\0\0\0/org/freedesktop/DBus\0\0\0\6\1s\0\24\0\0\0org.freedesktop.DBus\0\0\0\0\2\1s\0\24\0\0\0org.freedesktop.DBus\0\0\0\0\3\1s\0\10\0\0\0AddMatch\0\0\0\0\0\0\0\0\10\1g\0\1s\0\0", 144}, {"\241\0\0\0type='signal',sender='org.freedesktop.DBus',path='/org/freedesktop/DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='net.reactivated.Fprint'\0", 166}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 310
8204  sendmsg(11, {msg_name(0)=NULL, msg_iov(2)=[{"l\1\0\1\33\0\0\0\4\0\0\0\177\0\0\0\1\1o\0\25\0\0\0/org/freedesktop/DBus\0\0\0\6\1s\0\24\0\0\0org.freedesktop.DBus\0\0\0\0\2\1s\0\24\0\0\0org.freedesktop.DBus\0\0\0\0\3\1s\0\f\0\0\0GetNameOwner\0\0\0\0\10\1g\0\1s\0\0", 144}, {"\26\0\0\0net.reactivated.Fprint\0", 27}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 171
8204  sendmsg(11, {msg_name(0)=NULL, msg_iov(2)=[{"l\1\0\1\0\0\0\0\5\0\0\0\203\0\0\0\1\1o\0\37\0\0\0/net/reactivated/Fprint/Manager\0\6\1s\0\26\0\0\0net.reactivated.Fprint\0\0\2\1s\0\36\0\0\0net.reactivated.Fprint.Manager\0\0\3\1s\0\n\0\0\0GetDevices\0\0\0\0\0\0", 152}, {"", 0}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 152
8204  poll([{fd=11, events=POLLIN}], 1, 25000) = 1 ([{fd=11, revents=POLLIN}])
8204  recvmsg(11, {msg_name(0)=NULL, msg_iov(1)=[{"l\2\1\1\v\0\0\0\3\0\0\0=\0\0\0\6\1s\0\6\0\0\0:1.491\0\0\5\1u\0\4\0\0\0\10\1g\0\1s\0\0\7\1s\0\24\0\0\0org.freedesktop.DBus\0\0\0\0\6\0\0\0:1.413\0", 2048}], msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_CMSG_CLOEXEC) = 91
8204  write(12, "\1\0\0\0\0\0\0\0", 8)  = 8
8204  recvmsg(11, 0x7ffec28d8730, MSG_CMSG_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
8204  poll([{fd=11, events=POLLIN}], 1, 25000) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
8204  --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
8204  restart_syscall(<... resuming interrupted poll ...>) = 0
8204  sendmsg(11, {msg_name(0)=NULL, msg_iov(2)=[{"l\1\1\1\204\0\0\0\6\0\0\0\177\0\0\0\1\1o\0\25\0\0\0/org/freedesktop/DBus\0\0\0\6\1s\0\24\0\0\0org.freedesktop.DBus\0\0\0\0\2\1s\0\24\0\0\0org.freedesktop.DBus\0\0\0\0\3\1s\0\v\0\0\0RemoveMatch\0\0\0\0\0\10\1g\0\1s\0\0", 144}, {"\177\0\0\0type='signal',sender='net.reactivated.Fprint',path='/net/reactivated/Fprint/Manager',interface='net.reactivated.Fprint.Manager'\0", 132}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 276
8204  sendmsg(11, {msg_name(0)=NULL, msg_iov(2)=[{"l\1\1\1\246\0\0\0\7\0\0\0\177\0\0\0\1\1o\0\25\0\0\0/org/freedesktop/DBus\0\0\0\6\1s\0\24\0\0\0org.freedesktop.DBus\0\0\0\0\2\1s\0\24\0\0\0org.freedesktop.DBus\0\0\0\0\3\1s\0\v\0\0\0RemoveMatch\0\0\0\0\0\10\1g\0\1s\0\0", 144}, {"\241\0\0\0type='signal',sender='org.freedesktop.DBus',path='/org/freedesktop/DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='net.reactivated.Fprint'\0", 166}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 310

/etc/nsswitch.conf

#
# /etc/nsswitch.conf

passwd:     files sss
shadow:     files sss
group:      files sss
#initgroups: files

#hosts:     db files nisplus nis dns
hosts:      files mdns4_minimal [NOTFOUND=return] dns myhostname mymachines

# Example - obey only what nisplus tells us...
#services:   nisplus [NOTFOUND=return] files
#networks:   nisplus [NOTFOUND=return] files
#protocols:  nisplus [NOTFOUND=return] files
#rpc:        nisplus [NOTFOUND=return] files
#ethers:     nisplus [NOTFOUND=return] files
#netmasks:   nisplus [NOTFOUND=return] files

bootparams: nisplus [NOTFOUND=return] files

ethers:     files
netmasks:   files
networks:   files
protocols:  files
rpc:        files
services:   files sss

netgroup:   files sss

publickey:  nisplus

automount:  files sss
aliases:    files nisplus
  • Please provide full strace output, if necessary, post it to pastebin. – user140866 Jun 2 '16 at 13:12
  • still insufficient; poll call timeouts then recvmsg plays with something that comes from freedesktop code? strace -f -v -s300 -o log sudo ... will give the best info. – user140866 Jun 2 '16 at 13:16
  • Check that your syslog daemon is working correctly; For example, does logger 'Hello world' return within a reasonable amount of time? – malyy Jun 2 '16 at 13:16
  • 1
    So judging by connect(11, {sa_family=AF_LOCAL, sun_path="/run/dbus/system_bus_socket"}, 29) = 0 - you probably got problems with dbus, possibly dbus daemon is not running or malfunction. – user140866 Jun 2 '16 at 13:53
  • 1
    please add the contents of your /etc/nsswitch.conf to your question – cas Jun 3 '16 at 0:22
1

The full strace in your pastebin link shows that sudo is trying to open libnss-sss.so.2:

open("/lib64/libnss_sss.so.2", O_RDONLY|O_CLOEXEC) = 8

That's an NSS module for SSSD - System Security Services Daemon, which manages access to various remote authentication services.

Check that the SSSD is installed and running. If it is, then try following the instructions on that site for debugging sudo issues.

If it isn't then either find out why and fix it or (if you don't want/need sss) just edit /etc/nsswitch.conf and comment out or delete sss from all the services that are configured to use it.

  • Thanks for answering. I already reboot my laptop, I will check it when this happen again and let you know. – c0rp Jun 3 '16 at 8:19
  • I removed all sss but it is still long pause befora asking password. Also I can't restart sssd, it is saying: Job for sssd.service failed because the control process exited with error code. See "systemctl status sssd.service" and "journalctl -xe" for details. – c0rp Jun 3 '16 at 16:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.