Eu tenho várias sessões de tela GNU de longa duração. Eu ssh para a caixa em que eles estão correndo e corra screen -d -r foo
para separá-los se eles estiverem conectados em qualquer outro lugar, e então os anexe na minha janela atual.
99% das vezes isso funciona bem, mas às vezes eu entendo isso:
$ screen -d -r foo
[2430.foo detached.]
... e nada acontece; Eu não posso voltar para o shell em tudo. Tentar em outra janela faz a mesma coisa, a única coisa que posso fazer é destruir essa sessão de tela (perdendo todos os programas que estavam rodando nela) e recriá-la
Por que isso acontece? Como posso evitá-lo ou reconectar com sucesso quando isso acontece?
Editar : Meu .screenrc
:
startup_message off
defwritelock off
bind q quit
caption always '%{gk} (%n) %t %{y}%d %M %Y :: %c:%s %{b}%W%{d}'
screen -t ZSH
autodetach on
shelltitle ZSH
defutf8 on
Editar : o fim de um strace
log ao tentar anexar:
readlink("/proc/self/fd/0", "/dev/pts/14", 4095) = 11
stat64("/dev/pts/14", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 14), ...}) = 0
stat64("/dev/pts/14", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 14), ...}) = 0
geteuid32() = 1000
getegid32() = 1000
open("/dev/pts/14", O_RDWR|O_NONBLOCK) = 3
geteuid32() = 1000
getegid32() = 1000
close(3) = 0
ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
umask(0) = 022
lstat64("/var/run/screen", {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0
access("/var/run/screen/S-mrozekma", F_OK) = 0
stat64("/var/run/screen/S-mrozekma", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
umask(022) = 0
uname({sys="Linux", node="etudes-2", ...}) = 0
rt_sigaction(SIGHUP, {0x806e520, [], 0}, {SIG_DFL, [], 0}, 8) = 0
geteuid32() = 1000
getegid32() = 1000
open("/var/run/screen/S-mrozekma", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3
getdents(3, /* 6 entries */, 32768) = 124
stat64("/var/run/screen/S-mrozekma/2386.chat", {st_mode=S_IFIFO|0700, st_size=0, ...}) = 0
geteuid32() = 1000
getegid32() = 1000
open("/var/run/screen/S-mrozekma/2386.chat", O_WRONLY|O_NONBLOCK) = 4
geteuid32() = 1000
getegid32() = 1000
fcntl64(4, F_SETFL, O_RDONLY) = 0
geteuid32() = 1000
getegid32() = 1000
getdents(3, /* 0 entries */, 32768) = 0
close(3) = 0
geteuid32() = 1000
getegid32() = 1000
setuid32(1000) = 0
setgid32(1000) = 0
stat64("/var/run/screen/S-mrozekma/2386.chat", {st_mode=S_IFIFO|0700, st_size=0, ...}) = 0
getpid() = 30081
write(4, "$ screen -d -r foo
[2430.foo detached.]
gsmstartup_message off
defwritelock off
bind q quit
caption always '%{gk} (%n) %t %{y}%d %M %Y :: %c:%s %{b}%W%{d}'
screen -t ZSH
autodetach on
shelltitle ZSH
defutf8 on
readlink("/proc/self/fd/0", "/dev/pts/14", 4095) = 11
stat64("/dev/pts/14", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 14), ...}) = 0
stat64("/dev/pts/14", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 14), ...}) = 0
geteuid32() = 1000
getegid32() = 1000
open("/dev/pts/14", O_RDWR|O_NONBLOCK) = 3
geteuid32() = 1000
getegid32() = 1000
close(3) = 0
ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
umask(0) = 022
lstat64("/var/run/screen", {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0
access("/var/run/screen/S-mrozekma", F_OK) = 0
stat64("/var/run/screen/S-mrozekma", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
umask(022) = 0
uname({sys="Linux", node="etudes-2", ...}) = 0
rt_sigaction(SIGHUP, {0x806e520, [], 0}, {SIG_DFL, [], 0}, 8) = 0
geteuid32() = 1000
getegid32() = 1000
open("/var/run/screen/S-mrozekma", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3
getdents(3, /* 6 entries */, 32768) = 124
stat64("/var/run/screen/S-mrozekma/2386.chat", {st_mode=S_IFIFO|0700, st_size=0, ...}) = 0
geteuid32() = 1000
getegid32() = 1000
open("/var/run/screen/S-mrozekma/2386.chat", O_WRONLY|O_NONBLOCK) = 4
geteuid32() = 1000
getegid32() = 1000
fcntl64(4, F_SETFL, O_RDONLY) = 0
geteuid32() = 1000
getegid32() = 1000
getdents(3, /* 0 entries */, 32768) = 0
close(3) = 0
geteuid32() = 1000
getegid32() = 1000
setuid32(1000) = 0
setgid32(1000) = 0
stat64("/var/run/screen/S-mrozekma/2386.chat", {st_mode=S_IFIFO|0700, st_size=0, ...}) = 0
getpid() = 30081
write(4, "%pre%gsm%pre%%pre%%pre%/dev/pts/14%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%"..., 12336
%pre%/dev/pts/14%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%"..., 12336