My workstations run Debian Jessie and should automatically mount a remote directory over SSHFS when the user logs on to their desktop. We have a script to do so, located on the user's workstation:#!/bin/bashfusermount -u ~/remote-directorysshfs -o reconnect remote@server:/home/shared ~/remote-directoryI have tried everything I can think of. I referenced the .sh file in crontab @reboot and rc.local (after changing the tildes to direct paths to the directory), then changed it so that the commands themselves should be run. I have made sure both the .sh and rc.local are executable. When I reboot the workstation, the directory still does not automatically mount. Checking syslog, I get the following errors:rc.local[3140]: fusermount: failed to unmount /home/user/remote-directory: Invalid argumentsystemd-udevd[1592]: Process '/bin/mount -t fusectl fusectl /sys/fs/fuse/connections' failed with exit code 32.This leads me to believe there is a problem with the -u switch in the fusermount command, but when I run the script manually after login it works perfectly fine. Why won't it just work automatically if it works manually?
Fusermount mounting SSHFS directory works manually but not automatically?
mount;remote;automounting;sshfs
I found the problem. I was adding the fusermount script to crontab and rc.local, which run the script at startup. Instead, I needed to create a .desktop referencing the script and add it to /etc/xdg/autostart - this runs the script when the user logs in, usually after all the requisite services have started and the user credentials can be used to auth sshfs.