PDA

View Full Version : [SOLVED] Still unable to connect to sshfs shares on startup



kainwolf
May 25th 2012, 07:34 PM
I am still unble to connect to sshfs shares on 12.04 startup

I have tried the instructions from http://ubuntuforums.org/showthread.php?t=430312 (which works on my 10.04 machines) placing the following in /etc/fstab, and adding the :

sshfs kain@charizard:/home/kain /home/kain/charizard fuse defaults,noauto,users,uid=1000,gid=1000,reconnect, follow_symlinks,comment=sshfs 0 0
which results only in the error:
An error occurred while mounting kain@charizard:/home/kain.
Press S to skip mounting or M for manual recovery.

Also placing the command in .bashrc and/or .bash_profile:

sshfs kain@charizard:/home/kain /home/kain/charizard
doesn't mount the share, yet it mounts ok when typed in to a shell prompt after the system has booted.

SecretCode
May 25th 2012, 08:53 PM
I think this is because fstab "auto" mounts are mounted before the network is up. There's a parameter _netdev that tells it to wait, but the doc suggests it's only for nfs mounts. I'm not sure if there's a general solution to this need - I thought there was.

Did you look at the "if.up" script mentioned in the post you linked to? That would run when the network starts.

kainwolf
May 25th 2012, 09:02 PM
It seems that way... fstab is mounting before network is up, must have been a change from previous versions (at least a change from 10.04)

I have the scripts for if.up/mountsshfs and if.down/umountsshfs there, with 755 permissions. But I can't tell if they're running or not.

If I could even run the shell command after login it would be fine. But I can't find a place to put it where it would run. (I have the same problem with an xmodmap command.)

SecretCode
May 25th 2012, 09:33 PM
To run at login, you could go to System Settings > Startup and Shutdown > Autostart.

If you want to debug those scripts (at least, get some confirmation they are running) you could add logger commands. See man logger

kainwolf
May 25th 2012, 10:41 PM
Thanks, creating a script with the sshfs command and putting it in the Autostart seems to work.