slackware.ru
http://www.slackware.ru/forum/

hostname -f очень долго печатает вывод
http://www.slackware.ru/forum/viewtopic.php?f=44&t=2629
Страница 1 из 1

Автор:  nionio [ 02 ноя 2018 15:36 ]
Заголовок сообщения:  hostname -f очень долго печатает вывод

hostname -f очень долго печатает вывод. hostname моментально , с -f очень долго.

> cat /etc/hostname
machine.domain.com

> cat /etc/hosts.conf
order hosts, bind
multi on

> cat /etc/hosts
127.0.0.1 localhost
192.168.0.1 machine.domain.com machine

> cat /etc/nsswitch.conf | grep hosts
hosts: files dns

> cat /etc/resolv.conf
search domain.com
nameserver 8.8.8.8


когда в /etc/nsswitch.conf убираю dns - hostname -f работает моментально (или как должно) , но не работает сеть.
???

Автор:  nionio [ 02 ноя 2018 15:56 ]
Заголовок сообщения:  Re: hostname -f очень долго печатает вывод

вывод strace hostname -f

Код:
execve("/bin/hostname", ["hostname", "-f"], [/* 28 vars */]) = 0
brk(NULL)                               = 0x9b4f000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb775d000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=59738, ...}) = 0
mmap2(NULL, 59738, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb774e000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20\210\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1848572, ...}) = 0
mmap2(NULL, 1669660, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb75b6000
mprotect(0xb7747000, 4096, PROT_NONE)   = 0
mmap2(0xb7748000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x191000) = 0xb7748000
mmap2(0xb774b000, 10780, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb774b000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb75b5000
set_thread_area({entry_number:-1, base_addr:0xb75b5700, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0 (entry_number:6)
mprotect(0xb7748000, 8192, PROT_READ)   = 0
mprotect(0xb7786000, 4096, PROT_READ)   = 0
munmap(0xb774e000, 59738)               = 0
brk(NULL)                               = 0x9b4f000
brk(0x9b70000)                          = 0x9b70000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=2997, ...}) = 0
read(3, "# Locale name alias data base.\n#"..., 4096) = 2997
read(3, "", 4096)                       = 0
close(3)                                = 0
open("/usr/lib/locale/ru_RU.UTF-8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/ru_RU.utf8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=353, ...}) = 0
mmap2(NULL, 353, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb775c000
close(3)                                = 0
open("/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/gconv/gconv-modules", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=56095, ...}) = 0
read(3, "# GNU libc iconv configuration.\n"..., 4096) = 4096
read(3, "1002//\tJUS_I.B1.002//\nmodule\tJUS"..., 4096) = 4096
read(3, "ISO-IR-110//\t\tISO-8859-4//\nalias"..., 4096) = 4096
read(3, "\t\tISO-8859-14//\nalias\tISO_8859-1"..., 4096) = 4096
read(3, "IC-ES//\nalias\tEBCDICES//\t\tEBCDIC"..., 4096) = 4096
read(3, "DIC-CP-ES//\t\tIBM284//\nalias\tCSIB"..., 4096) = 4096
read(3, "//\nalias\tCSIBM864//\t\tIBM864//\nal"..., 4096) = 4096
read(3, "BM939//\nmodule\tIBM939//\t\tINTERNA"..., 4096) = 4096
read(3, "EUC-CN//\nalias\tCN-GB//\t\t\tEUC-CN/"..., 4096) = 4096
read(3, "T//\nmodule\tISO-2022-CN-EXT//\tINT"..., 4096) = 4096
read(3, "//\t\tISO_5428//\nalias\tISO_5428:19"..., 4096) = 4096
read(3, "CII-8\t1\n\n#\tfrom\t\t\tto\t\t\tmodule\t\tc"..., 4096) = 4096
read(3, "\tfrom\t\t\tto\t\t\tmodule\t\tcost\nalias\t"..., 4096) = 4096
read(3, "712//\t\tINTERNAL\t\tIBM12712\t\t1\nmod"..., 4096) = 2847
read(3, "", 4096)                       = 0
close(3)                                = 0
open("/usr/lib/locale/ru_RU.UTF-8/LC_MEASUREMENT", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/ru_RU.utf8/LC_MEASUREMENT", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=23, ...}) = 0
mmap2(NULL, 23, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb775b000
close(3)                                = 0
open("/usr/lib/locale/ru_RU.UTF-8/LC_TELEPHONE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/ru_RU.utf8/LC_TELEPHONE", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=52, ...}) = 0
mmap2(NULL, 52, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb775a000
close(3)                                = 0
open("/usr/lib/locale/ru_RU.UTF-8/LC_ADDRESS", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/ru_RU.utf8/LC_ADDRESS", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=139, ...}) = 0
mmap2(NULL, 139, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7759000
close(3)                                = 0
open("/usr/lib/locale/ru_RU.UTF-8/LC_NAME", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/ru_RU.utf8/LC_NAME", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=62, ...}) = 0
mmap2(NULL, 62, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7758000
close(3)                                = 0
open("/usr/lib/locale/ru_RU.UTF-8/LC_PAPER", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/ru_RU.utf8/LC_PAPER", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=34, ...}) = 0
mmap2(NULL, 34, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7757000
close(3)                                = 0
open("/usr/lib/locale/ru_RU.UTF-8/LC_MESSAGES", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/ru_RU.utf8/LC_MESSAGES", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
close(3)                                = 0
open("/usr/lib/locale/ru_RU.utf8/LC_MESSAGES/SYS_LC_MESSAGES", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=60, ...}) = 0
mmap2(NULL, 60, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7756000
close(3)                                = 0
open("/usr/lib/locale/ru_RU.UTF-8/LC_MONETARY", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/ru_RU.utf8/LC_MONETARY", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=302, ...}) = 0
mmap2(NULL, 302, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7755000
close(3)                                = 0
open("/usr/lib/locale/ru_RU.UTF-8/LC_TIME", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/ru_RU.utf8/LC_TIME", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=2498, ...}) = 0
mmap2(NULL, 2498, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7754000
close(3)                                = 0
open("/usr/lib/locale/ru_RU.UTF-8/LC_NUMERIC", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/ru_RU.utf8/LC_NUMERIC", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=54, ...}) = 0
mmap2(NULL, 54, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7753000
close(3)                                = 0
open("/usr/lib/locale/ru_RU.UTF-8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/ru_RU.utf8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=317692, ...}) = 0
mmap2(NULL, 317692, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7567000
close(3)                                = 0
uname({sysname="Linux", nodename="nionio", ...}) = 0
getpid()                                = 860
open("/etc/resolv.conf", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=35, ...}) = 0
read(3, "domain lcdomain.com\nnameserver 8.8.8."..., 4096) = 35
read(3, "", 4096)                       = 0
close(3)                                = 0
socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_LOCAL, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
close(3)                                = 0
socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_LOCAL, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
close(3)                                = 0
open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=1294, ...}) = 0
read(3, "#\n# /etc/nsswitch.conf\n#\n# An ex"..., 4096) = 1294
read(3, "", 4096)                       = 0
close(3)                                = 0
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=59738, ...}) = 0
mmap2(NULL, 59738, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7558000
close(3)                                = 0
open("/lib/libnss_files.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\360\31\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=49332, ...}) = 0
mmap2(NULL, 70468, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7546000
mmap2(0xb7550000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9000) = 0xb7550000
mmap2(0xb7552000, 21316, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7552000
close(3)                                = 0
mprotect(0xb7550000, 4096, PROT_READ)   = 0
munmap(0xb7558000, 59738)               = 0
open("/etc/host.conf", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=27, ...}) = 0
read(3, "order hosts, bind\nmulti on\n", 4096) = 27
read(3, "", 4096)                       = 0
close(3)                                = 0
open("/etc/hosts", O_RDONLY|O_CLOEXEC)  = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=618, ...}) = 0
read(3, "#\n# hosts\t\tThis file describes a"..., 4096) = 618
read(3, "", 4096)                       = 0
close(3)                                = 0
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=59738, ...}) = 0
mmap2(NULL, 59738, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7558000
close(3)                                = 0
open("/lib/libnss_dns.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\360\n\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=25288, ...}) = 0
mmap2(NULL, 24688, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb753f000
mmap2(0xb7544000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0xb7544000
close(3)                                = 0
open("/lib/libresolv.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`&\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=110884, ...}) = 0
mmap2(NULL, 112616, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7523000
mprotect(0xb753a000, 4096, PROT_NONE)   = 0
mmap2(0xb753b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0xb753b000
mmap2(0xb753d000, 6120, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb753d000
close(3)                                = 0
mprotect(0xb753b000, 4096, PROT_READ)   = 0
mprotect(0xb7544000, 4096, PROT_READ)   = 0
munmap(0xb7558000, 59738)               = 0
socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("8.8.8.8")}, 16) = 0
poll([{fd=3, events=POLLOUT}], 1, 0)    = 1 ([{fd=3, revents=POLLOUT}])
send(3, "b*\1\0\0\1\0\0\0\0\0\0\5nionio\3lcdomain\3com\0\0\34\0\1", 31, MSG_NOSIGNAL) = 31
poll([{fd=3, events=POLLIN}], 1, 5000)  = 0 (Timeout)
poll([{fd=3, events=POLLOUT}], 1, 0)    = 1 ([{fd=3, revents=POLLOUT}])
send(3, "b*\1\0\0\1\0\0\0\0\0\0\5nionio\3lcdomain\3com\0\0\34\0\1", 31, MSG_NOSIGNAL) = 31
poll([{fd=3, events=POLLIN}], 1, 5000)  = 0 (Timeout)
close(3)                                = 0
socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("8.8.8.8")}, 16) = 0
poll([{fd=3, events=POLLOUT}], 1, 0)    = 1 ([{fd=3, revents=POLLOUT}])
send(3, "F\t\1\0\0\1\0\0\0\0\0\0\5nionio\0\0\34\0\1", 23, MSG_NOSIGNAL) = 23
poll([{fd=3, events=POLLIN}], 1, 5000)  = 0 (Timeout)
poll([{fd=3, events=POLLOUT}], 1, 0)    = 1 ([{fd=3, revents=POLLOUT}])
send(3, "F\t\1\0\0\1\0\0\0\0\0\0\5nionio\0\0\34\0\1", 23, MSG_NOSIGNAL) = 23
poll([{fd=3, events=POLLIN}], 1, 5000)  = 0 (Timeout)
close(3)                                = 0
open("/etc/hosts", O_RDONLY|O_CLOEXEC)  = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=618, ...}) = 0
read(3, "#\n# hosts\t\tThis file describes a"..., 4096) = 618
read(3, "", 4096)                       = 0
close(3)                                = 0
fstat64(1, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
write(1, "nionio.lcdomain.com\n", 14)         = 14
exit_group(0)                           = ?
+++ exited with 0 +++

Автор:  nionio [ 02 ноя 2018 17:15 ]
Заголовок сообщения:  Re: hostname -f очень долго печатает вывод

может быть надо запустить /usr/bin/nsсd
а из какого скрипта оно запускается

Страница 1 из 1 Часовой пояс: UTC + 3 часа
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/