O título diz tudo. De qualquer forma, eu acabei de atualizar meu servidor de 14.04 LTS para 16.04 LTS e percebi que o sudo é executado muito mais lento que o 14.04.
Eu me esforcei e obtive o seguinte resultado:
$ sudo strace sudo true
---------------------------- snip -------------------------------
...
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 9
bind(9, {sa_family=AF_INET, sin_port=htons(722), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
bind(9, {sa_family=AF_INET, sin_port=htons(723), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
bind(9, {sa_family=AF_INET, sin_port=htons(724), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
bind(9, {sa_family=AF_INET, sin_port=htons(725), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
bind(9, {sa_family=AF_INET, sin_port=htons(726), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
bind(9, {sa_family=AF_INET, sin_port=htons(727), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
bind(9, {sa_family=AF_INET, sin_port=htons(728), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
bind(9, {sa_family=AF_INET, sin_port=htons(729), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
bind(9, {sa_family=AF_INET, sin_port=htons(730), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
bind(9, {sa_family=AF_INET, sin_port=htons(731), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
bind(9, {sa_family=AF_INET, sin_port=htons(732), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
bind(9, {sa_family=AF_INET, sin_port=htons(733), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
bind(9, {sa_family=AF_INET, sin_port=htons(734), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
bind(9, {sa_family=AF_INET, sin_port=htons(735), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
bind(9, {sa_family=AF_INET, sin_port=htons(736), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
bind(9, {sa_family=AF_INET, sin_port=htons(737), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
bind(9, {sa_family=AF_INET, sin_port=htons(738), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
bind(9, {sa_family=AF_INET, sin_port=htons(739), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
...
---------------------------- snip -------------------------------
O próprio comando sudo foi bem-sucedido, demorou muito tempo, como 5 segundos.
O intervalo de porta é 512-1023, parece que ele tenta ligar a porta de privilégio para algo como garantir que está tendo privilégio de superusuário.
E após o sucesso do sudo, netstat -an
mostra:
---------------------------- snip -------------------------------
...
tcp 0 0 192.168.0.10:959 192.168.0.1:617 TIME_WAIT
tcp 0 0 192.168.0.10:910 192.168.0.1:617 TIME_WAIT
tcp 0 0 192.168.0.10:932 192.168.0.1:617 TIME_WAIT
tcp 0 0 192.168.0.10:34470 192.168.0.1:111 TIME_WAIT
tcp 0 0 192.168.0.10:966 192.168.0.1:617 TIME_WAIT
tcp 0 0 192.168.0.10:903 192.168.0.1:617 TIME_WAIT
tcp 0 0 192.168.0.10:875 192.168.0.1:617 TIME_WAIT
tcp 0 0 192.168.0.10:45452 192.168.0.1:111 TIME_WAIT
tcp 0 0 192.168.0.10:970 192.168.0.1:617 TIME_WAIT
tcp 0 0 192.168.0.10:907 192.168.0.1:617 TIME_WAIT
tcp 0 0 192.168.0.10:41063 192.168.0.1:111 TIME_WAIT
tcp 0 0 192.168.0.10:45659 192.168.0.1:111 TIME_WAIT
tcp 0 0 192.168.0.10:948 192.168.0.1:617 TIME_WAIT
tcp 0 0 192.168.0.10:50370 192.168.0.1:111 TIME_WAIT
tcp 0 0 192.168.0.10:56145 192.168.0.1:111 TIME_WAIT
tcp 0 0 192.168.0.10:929 192.168.0.1:617 TIME_WAIT
tcp 0 0 192.168.0.10:909 192.168.0.1:617 TIME_WAIT
tcp 0 0 192.168.0.10:33648 192.168.0.1:111 TIME_WAIT
tcp 0 0 192.168.0.10:33556 192.168.0.1:111 TIME_WAIT
tcp 0 0 192.168.0.10:55209 192.168.0.1:111 TIME_WAIT
tcp 0 0 192.168.0.10:975 192.168.0.1:617 TIME_WAIT
tcp 0 0 192.168.0.10:969 192.168.0.1:617 TIME_WAIT
tcp 0 0 192.168.0.10:35903 192.168.0.1:111 TIME_WAIT
tcp 0 0 192.168.0.10:888 192.168.0.1:617 TIME_WAIT
...
---------------------------- snip -------------------------------
Onde 192.168.0.10 é o meu servidor e 192.168.0.1 é o servidor NIS.
Quando eu parar o ypbind
no meu servidor e executar o sudo
, nenhuma ligação mais inútil (2) e nenhum outro TIME_WAIT entre meu servidor e o servidor NIS serão observados.
Não consigo parar o ypbind
e quero que meu antigo% ágilsudo
volte tão rápido B)
O que posso fazer?
Obrigado