Eu olhei para isso e o problema parece ser a falta da biblioteca libnss_wins.so
, e eu verifiquei como garantir que isso existe na minha máquina e achei sudo apt-get install libnss-winbind
e isso resolveu o problema imediatamente.
Mais informações: Eu verifiquei o que estava acontecendo, capturando a saída de strace ping mywindowsmachine
e o problema foi fácil de detectar, pois o programa estava tentando encontrar um arquivo que simplesmente não estava lá, libnss_wins.so.2
. Isso mostrou uma solução potencial de simplesmente garantir que o arquivo esteja presente. Abaixo está a saída strace truncada para mostrar apenas as linhas relativas a uma busca por esse arquivo libnss_wins.so.2
, e o importante aqui é que cada tentativa de encontrar o arquivo falha, até o último. Na minha outra máquina Ubuntu, eu comparei a mesma saída strace
, e lá ele conseguiu talvez a quarta ou quinta tentativa:
open("/lib/x86_64-linux-gnu/tls/x86_64/libnss_wins.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu/tls/x86_64", 0x7ffd56786e80) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/tls/libnss_wins.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu/tls", 0x7ffd56786e80) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/x86_64/libnss_wins.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu/x86_64", 0x7ffd56786e80) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libnss_wins.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu", {st_mode=S_IFDIR|0755, st_size=12288, ...}) = 0
open("/usr/lib/x86_64-linux-gnu/tls/x86_64/libnss_wins.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64-linux-gnu/tls/x86_64", 0x7ffd56786e80) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/tls/libnss_wins.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64-linux-gnu/tls", 0x7ffd56786e80) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/x86_64/libnss_wins.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64-linux-gnu/x86_64", 0x7ffd56786e80) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/libnss_wins.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64-linux-gnu", {st_mode=S_IFDIR|0755, st_size=69632, ...}) = 0
open("/lib/tls/x86_64/libnss_wins.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/tls/x86_64", 0x7ffd56786e80) = -1 ENOENT (No such file or directory)
open("/lib/tls/libnss_wins.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/tls", 0x7ffd56786e80) = -1 ENOENT (No such file or directory)
open("/lib/x86_64/libnss_wins.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64", 0x7ffd56786e80) = -1 ENOENT (No such file or directory)
open("/lib/libnss_wins.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/usr/lib/tls/x86_64/libnss_wins.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/tls/x86_64", 0x7ffd56786e80) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/libnss_wins.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/tls", 0x7ffd56786e80) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64/libnss_wins.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64", 0x7ffd56786e80) = -1 ENOENT (No such file or directory)
open("/usr/lib/libnss_wins.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)