sshfs not working when called from sleep.d

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
s4bba7

sshfs not working when called from sleep.d

Post by s4bba7 »

Hello!
I'm using sshfs to mount my private share (without password, only RSA key). When I run this command:

Code: Select all

sshfs <username>@<adress>:/<sharename>/ /home/<username>/<local folder>/ -p <port> -o reconnect,uid=<1000>,gid=<1001>
it mounts share correctly. Then I made file in /etc/pm/sleep.d/50_sshfs and add:

Code: Select all

#!/bin/bash

case $1 in
        hibernate|suspend)
		grep "/home/<username>/<local folder> fuse.sshfs" /etc/mtab
		if [[ $? -eq 0 ]]; then
			fusermount -u /home/<username>/<local folder>
		fi
                ;;
        resume|thaw)
		sshfs <username>@<adress>:/<sharename>/ /home/<username>/<local folder>/ -p <port> -o reconnect,uid=<1000>,gid=<1001>
                ;;
esac
Before going to sleep or hibernate it unmounts correctly, but after resume or wake up it doesn't mount the share.
Any idea why and how to correct this error?
Cheers!

//EDIT
Ok, I found that I need to add RSA key to root user.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Locked

Return to “Storage”