Quando eu tento acessar uma pasta montada em SMB de dentro de uma caixa Virtual do Vagrant CentOS em um sistema Windows 8.1, meu shell trava


1

Estou executando o Oracle VirtualBox 4.3.10 no Windows 8.1 e dentro estou executando o CentOS 6.5. Eu tenho um / windows montado na minha máquina Windows através do SMB. Normalmente eu uso o sistema de arquivos / vagrant vboxfs, mas quando tento visualizar o diretório / windows, ele bloqueia meu shell. Eu não posso usar ^ C, ^ Z, nem posso enviar SIGKILL ou qualquer outro sinal de Putty.

[vagrant@localhost BK-Development]$ mount
/dev/mapper/VolGroup-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
//10.0.2.2/aidc on /windows type cifs (rw)
/vagrant on /vagrant type vboxsf (uid=500,gid=500,rw)

Aqui está uma sequência de sls.

[vagrant@localhost ~]$ strace ls /windows
execve("/bin/ls", ["ls", "/windows"], [/* 39 vars */]) = 0
brk(0)                                  = 0x857000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f63abd79000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=39412, ...}) = 0
mmap(NULL, 39412, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f63abd6f000
close(3)                                = 0
open("/lib64/libselinux.so.1", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0PX\200\270>\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=124624, ...}) = 0
mmap(0x3eb8800000, 2221912, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3eb8800000
mprotect(0x3eb881d000, 2093056, PROT_NONE) = 0
mmap(0x3eb8a1c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c000) = 0x3eb8a1c000
mmap(0x3eb8a1e000, 1880, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3eb8a1e000
close(3)                                = 0
open("/lib64/librt.so.1", O_RDONLY)     = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@!\0\270>\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=47064, ...}) = 0
mmap(0x3eb8000000, 2128816, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3eb8000000
mprotect(0x3eb8007000, 2093056, PROT_NONE) = 0
mmap(0x3eb8206000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x3eb8206000
close(3)                                = 0
open("/lib64/libcap.so.2", O_RDONLY)    = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\23@\275>\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=19016, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f63abd6e000
mmap(0x3ebd400000, 2111776, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3ebd400000
mprotect(0x3ebd404000, 2093056, PROT_NONE) = 0
mmap(0x3ebd603000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x3ebd603000
close(3)                                = 0
open("/lib64/libacl.so.1", O_RDONLY)    = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200\36\300\273>\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=33816, ...}) = 0
mmap(0x3ebbc00000, 2126416, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3ebbc00000
mprotect(0x3ebbc07000, 2093056, PROT_NONE) = 0
mmap(0x3ebbe06000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x3ebbe06000
close(3)                                = 0
open("/lib64/libc.so.6", O_RDONLY)      = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\356A\267>\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1926800, ...}) = 0
mmap(0x3eb7400000, 3750152, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3eb7400000
mprotect(0x3eb758b000, 2093056, PROT_NONE) = 0
mmap(0x3eb778a000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18a000) = 0x3eb778a000
mmap(0x3eb778f000, 18696, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3eb778f000
close(3)                                = 0
open("/lib64/libdl.so.2", O_RDONLY)     = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\r\300\267>\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=22536, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f63abd6d000
mmap(0x3eb7c00000, 2109696, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3eb7c00000
mprotect(0x3eb7c02000, 2097152, PROT_NONE) = 0
mmap(0x3eb7e02000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x3eb7e02000
close(3)                                = 0
open("/lib64/libpthread.so.0", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340]\200\267>\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=145896, ...}) = 0
mmap(0x3eb7800000, 2212848, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3eb7800000
mprotect(0x3eb7817000, 2097152, PROT_NONE) = 0
mmap(0x3eb7a17000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x3eb7a17000
mmap(0x3eb7a19000, 13296, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3eb7a19000
close(3)                                = 0
open("/lib64/libattr.so.1", O_RDONLY)   = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200\23\200\273>\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=21152, ...}) = 0
mmap(0x3ebb800000, 2113888, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3ebb800000
mprotect(0x3ebb804000, 2093056, PROT_NONE) = 0
mmap(0x3ebba03000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x3ebba03000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f63abd6c000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f63abd6a000
arch_prctl(ARCH_SET_FS, 0x7f63abd6a7a0) = 0
mprotect(0x3eb8a1c000, 4096, PROT_READ) = 0
mprotect(0x3eb8206000, 4096, PROT_READ) = 0
mprotect(0x3ebbe06000, 4096, PROT_READ) = 0
mprotect(0x3eb778a000, 16384, PROT_READ) = 0
mprotect(0x3eb7e02000, 4096, PROT_READ) = 0
mprotect(0x3eb6e1f000, 4096, PROT_READ) = 0
mprotect(0x3eb7a17000, 4096, PROT_READ) = 0
mprotect(0x3ebba03000, 4096, PROT_READ) = 0
munmap(0x7f63abd6f000, 39412)           = 0
set_tid_address(0x7f63abd6aa70)         = 20555
set_robust_list(0x7f63abd6aa80, 0x18)   = 0
futex(0x7fff8e671fec, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7fff8e671fec, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, 7f63abd6a7a0) = -1 EAGAIN (Resource temporarily unavailable)
rt_sigaction(SIGRTMIN, {0x3eb7805c60, [], SA_RESTORER|SA_SIGINFO, 0x3eb780f710}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0x3eb7805cf0, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x3eb780f710}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=10240*1024, rlim_max=RLIM_INFINITY}) = 0
statfs("/selinux", {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=2242612, f_bfree=557842, f_bavail=443922, f_files=570080, f_ffree=265231, f_fsid={1226513072, 1470288141}, f_namelen=255, f_frsize=4096}) = 0
brk(0)                                  = 0x857000
brk(0x878000)                           = 0x878000
open("/proc/filesystems", O_RDONLY)     = 3
fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f63abd78000
read(3, "nodev\tsysfs\nnodev\trootfs\nnodev\tb"..., 1024) = 328
read(3, "", 1024)                       = 0
close(3)                                = 0
munmap(0x7f63abd78000, 4096)            = 0
open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=99158576, ...}) = 0
mmap(NULL, 99158576, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f63a5ed9000
close(3)                                = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TIOCGWINSZ, {ws_row=46, ws_col=142, ws_xpixel=0, ws_ypixel=0}) = 0
stat("/windows",

Aqui é onde ela trava. Aqui está a versão completa.

[vagrant@localhost BK-Development]$ uname -a
Linux localhost.localdomain 2.6.32-431.11.2.el6.x86_64 #1 SMP Tue Mar 25 19:59:55 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Eu fui capaz de resolver parcialmente isso indo para o / windows SMB mount depois que o Vagrant inicia e ficando lá com um programa rodando (eu presumo manter um arquivo aberto?). Caso contrário, parece que se nenhum manipulador de arquivos for usado após várias horas, ele será bloqueado ao tentar acessá-lo novamente.
Chloe

Respostas:


2

Eu tive o mesmo problema no Windows 7. O Windows corta conexões que são consideradas inativas, como conexões sem identificadores de arquivos abertos.

A VM do Linux é bloqueada porque o driver CIFS não gosta de ser desconectado e não pode se recuperar.

Ela afeta os processos porque eles estão em um estado interrompido esperando o driver do sistema de arquivos CIFS voltar, o que nunca acontece. Você não pode matá-los, pois matá-los requer o envio de um sinal de interrupção, mas eles já estão em um estado interrompido enquanto esperam pelo driver. Mais detalhes disponíveis aqui .

Você pode evitar o problema desativando o recurso de desconexão automática no Windows, que funcionou para mim. Basta executar em um prompt de comando:

net config server /autodisconnect:-1
Ao utilizar nosso site, você reconhece que leu e compreendeu nossa Política de Cookies e nossa Política de Privacidade.
Licensed under cc by-sa 3.0 with attribution required.