autofs falha ao montar uma unidade remota usando sshfs - fusível

2

Atualmente, estou desenvolvendo um aplicativo para o qual preciso recuperar alguns arquivos de um local remoto, que só posso acessar por meio do ssh. Desde que eu preciso para automount esse repo, tentei criar um autofs sobre ele (não pode colocá-lo no fstab desde fstab não montá-lo de volta após falhas de rede).

Unfortunaltely, encontrei algum problema configurando-o. Apesar da minha pesquisa, não consegui encontrar nenhuma pista sobre o meu problema ... então aqui estou eu.

Basicamente, estou tentando fazer automaticamente o que costumava fazer dessa maneira:

sshfs [email protected]: /mnt/mylocalrepo -o allow_other 

Eu preciso disso para um usuário de tomcat cujo pid é 502. Para fazer isso, aqui está o meu auto.master:

# $Id: auto.master,v 1.4 2005/01/04 14:36:54 raven Exp $ 
/misc   /etc/auto.misc
/net    -hosts
/mnt    /etc/auto.sshfs --timeout=30, --ghost,  --debug

e meu auto.sshfs:

mylocalrepo -fstype=fuse,uid=502,gid=502,IdentityFile=/root/.ssh/myRsaPrivateKey,ro,allow_other :sshfs\#[email protected]\:

Eu também defino o nível de saída para 'debug' em / etc / sysconfg / autofs.

Em seguida, /etc/init.d/autofs restart.

Infelizmente, nada acontece .... Os logs dizem:

Dec 19 11:52:03 something automount[17018]: handle_packet: type = 3
Dec 19 11:52:03 something automount[17018]: handle_packet_missing_indirect: token 279, name mylocalrepo, request pid 18480
Dec 19 11:52:03 something automount[17018]: attempting to mount entry /mnt/mylocalrepo
Dec 19 11:52:03 something automount[17018]: lookup_mount: lookup(file): looking up mylocalrepo
Dec 19 11:52:03 something automount[17018]: lookup_mount: lookup(file): mylocalrepo -> -fstype=fuse,uid=502,gid=502,IdentityFile=/root/.ssh/myRsaPrivateKey,rw,allow_other :sshfs\#[email protected]\:
Dec 19 11:52:03 something automount[17018]: parse_mount: parse(sun): expanded entry: -fstype=fuse,uid=502,gid=502,IdentityFile=/root/.ssh/myRsaPrivateKey,rw,allow_other :sshfs\#[email protected]\:
Dec 19 11:52:03 something automount[17018]: parse_mount: parse(sun): gathered options: fstype=fuse,uid=502,gid=502,IdentityFile=/root/.ssh/myRsaPrivateKey,rw,allow_other
Dec 19 11:52:03 something automount[17018]: parse_mount: parse(sun): dequote(":sshfs\#[email protected]\:") -> :sshfs#[email protected]:
Dec 19 11:52:03 something automount[17018]: parse_mount: parse(sun): core of entry: options=fstype=fuse,uid=502,gid=502,IdentityFile=/root/.ssh/myRsaPrivateKey,rw,allow_other, loc=:sshfs#[email protected]:
Dec 19 11:52:03 something automount[17018]: sun_mount: parse(sun): mounting root /mnt, mountpoint mylocalrepo, what sshfs#[email protected]:, fstype fuse, options uid=502,gid=502,IdentityFile=/root/.ssh/myRsaPrivateKey,rw,allow_other
Dec 19 11:52:03 something automount[17018]: do_mount: sshfs#[email protected]: /mnt/mylocalrepo type fuse options uid=502,gid=502,IdentityFile=/root/.ssh/myRsaPrivateKey,rw,allow_other using module generic
Dec 19 11:52:03 something automount[17018]: mount_mount: mount(generic): calling mkdir_path /mnt/mylocalrepo
Dec 19 11:52:03 something automount[17018]: mount_mount: mount(generic): calling mount -t fuse -s -o uid=502,gid=502,IdentityFile=/root/.ssh/myRsaPrivateKey,rw,allow_other sshfs#[email protected]: /mnt/mylocalrepo

O repositório está em / mnt /:

dr-xr-xr-x 2 root root 0 déc 19 11:51 mylocalrepo

Mas quando eu tento acessá-lo, através do usuário root, ou através do usuário tomcat, depois de alguns minutos de congelamento, eu pego isso nos logs:

Dec 19 12:16:34 something automount[17018]: mount(generic): failed to mount sshfs#[email protected]: (type fuse) on /mnt/mylocalrepo
Dec 19 12:16:34 something automount[17018]: dev_ioctl_send_fail: token = 280
Dec 19 12:16:34 something automount[17018]: failed to mount /mnt/mylocalrepo
Dec 19 12:16:34 something automount[17018]: handle_packet: type = 3
Dec 19 12:16:34 something automount[17018]: handle_packet_missing_indirect: token 281, name mylocalrepo, request pid 18480
Dec 19 12:16:34 something automount[17018]: attempting to mount entry /mnt/mylocalrepo
Dec 19 12:16:34 something automount[17018]: lookup_mount: lookup(file): looking up mylocalrepo
Dec 19 12:16:34 something automount[17018]: dev_ioctl_send_fail: token = 281
Dec 19 12:16:34 something automount[17018]: failed to mount /mnt/mylocalrepo

Então, se algum de vocês tem alguma idéia ou dica sobre o meu problema ou como encontrar mais pistas sobre isso, eles são de fato bem-vindos!

Obrigado antecipadamente.

Minhas configurações:

autofs-5.0.1-0.rc2.143.el5_5.6 kernel 2.6.18-194.32.1.el5 CentOS release 5.5 (Final)

PS: este post é uma cópia quase exata de um que eu postei no estouro de pilha ... mas parecia que não era o lugar para perguntar isso. Então, espero que este lugar seja. Se ainda não é, por favor, tome tempo para explicar o porquê.

    
por Marvin 08.01.2013 / 15:37

1 resposta

0

autofs tenta executar a montagem como o usuário root. Para testar se sua configuração pode funcionar, efetue login como root (su -) e tente a linha de montagem a partir do seu log de início do autofs:

'mount -t fuse -s -o uid=502,gid=502,IdentityFile=/root/.ssh/myRsaPrivateKey,rw,allow_other sshfs#[email protected]: /mnt/mylocalrepo'

Como o autofs faz exatamente isso (ele chama mount com os argumentos listados, como o usuário root), ele deve falhar e fornecer uma saída de depuração mais decente. Normalmente, acho que os problemas de permissão para o arquivo de identidade são os culpados.

    
por 03.06.2013 / 17:31

Tags