You are not logged in.

#1 2020-07-21 11:17:17

F43nd1r
Member
Registered: 2019-09-04
Posts: 34

[Solved] Timeout sshfs mount

I have defined the following systemd mount point:

/etc/systemd/system/server.mount

[Unit]
Description=Server
Wants=network-online.target

[Mount]
What=xxx@xxx.com:/home/xxx
Where=/server
Type=fuse.sshfs
Options=noauto,_netdev,IdentityFile=/home/xxx/.ssh/id_rsa,reconnect,uid=1000,gid=1000,sshfs_debug,ssh_command=ssh\040-F\040/home/xxx/.ssh/config,allow_other
Environment=SSH_AUTH_SOCK=/run/user/1000/ssh-agent.socket

[Install]
WantedBy=multi-user.target

When I

systemctl start server.mount

the unit, the mount works for a few moments (I can access files in a file manager), but then systemd reports a timeout and kills the mount.

Logs:

Jul 21 12:57:14 xxx systemd[1]: Mounting Server...
Jul 21 12:57:14 xxx mount[17164]: SSHFS version 3.7.0
Jul 21 12:57:14 xxx mount[17166]: executing <ssh> <-F> </home/xxx/.ssh/config> <-x> <-a> <-oClearAllForwardings=yes> <-oIdentityFile=/home/xxx/.ssh/id_rsa> <-2> <xxx@xxx.com> <-s> <sftp>
Jul 21 12:57:14 xxx mount[17164]: Server version: 3
Jul 21 12:57:14 xxx mount[17164]: Extension: posix-rename@openssh.com <1>
Jul 21 12:57:14 xxx mount[17164]: Extension: statvfs@openssh.com <2>
Jul 21 12:57:14 xxx mount[17164]: Extension: fstatvfs@openssh.com <2>
Jul 21 12:57:14 xxx mount[17164]: Extension: hardlink@openssh.com <1>
Jul 21 12:57:14 xxx mount[17164]: Extension: fsync@openssh.com <1>
Jul 21 12:57:14 xxx mount[17164]: Extension: lsetstat@openssh.com <1>
Jul 21 12:57:14 xxx mount[17164]: [00001] LSTAT
Jul 21 12:57:14 xxx mount[17164]:   [00001]         STATUS       33bytes (13ms)
Jul 21 12:57:14 xxx mount[17164]: [00002] LSTAT
Jul 21 12:57:14 xxx mount[17164]:   [00002]         STATUS       33bytes (13ms)
Jul 21 12:57:23 xxx mount[17164]: [00003] LSTAT
Jul 21 12:57:23 xxx mount[17164]:   [00003]          ATTRS       41bytes (18ms)
Jul 21 12:57:23 xxx mount[17164]: [00004] EXTENDED
Jul 21 12:57:23 xxx mount[17164]: [00005] EXTENDED
Jul 21 12:57:23 xxx mount[17164]:   [00004] EXTENDED_REPLY       97bytes (29ms)
Jul 21 12:57:23 xxx mount[17164]:   [00005] EXTENDED_REPLY       97bytes (24ms)
Jul 21 12:57:23 xxx mount[17164]: [00006] EXTENDED
Jul 21 12:57:23 xxx mount[17164]:   [00006] EXTENDED_REPLY       97bytes (35ms)
Jul 21 12:57:25 xxx mount[17164]: [00007] EXTENDED
Jul 21 12:57:25 xxx mount[17164]:   [00007] EXTENDED_REPLY       97bytes (18ms)
Jul 21 12:57:25 xxx mount[17164]: [00008] OPENDIR
Jul 21 12:57:25 xxx mount[17164]: [00009] EXTENDED
Jul 21 12:57:25 xxx mount[17164]:   [00008]         HANDLE       17bytes (15ms)
Jul 21 12:57:25 xxx mount[17164]:   [00009] EXTENDED_REPLY       97bytes (14ms)
Jul 21 12:57:25 xxx mount[17164]: [00010] READDIR
Jul 21 12:57:25 xxx mount[17164]: [00011] READDIR
Jul 21 12:57:25 xxx mount[17164]:   [00010]           NAME     1577bytes (15ms)
Jul 21 12:57:25 xxx mount[17164]:   [00011]         STATUS       32bytes (15ms)
Jul 21 12:57:25 xxx mount[17164]: [00012] READDIR
Jul 21 12:57:25 xxx mount[17164]: [00013] READDIR
Jul 21 12:57:25 xxx mount[17164]: [00014] CLOSE
Jul 21 12:57:25 xxx mount[17164]: [00015] LSTAT
Jul 21 12:57:25 xxx mount[17164]:   [00012]         STATUS       32bytes (14ms)
Jul 21 12:57:25 xxx mount[17164]:   [00013]         STATUS       32bytes (14ms)
Jul 21 12:57:25 xxx mount[17164]:   [00014]         STATUS       28bytes (18ms)
Jul 21 12:57:25 xxx mount[17164]:   [00015]         STATUS       33bytes (18ms)
Jul 21 12:57:25 xxx mount[17164]: [00016] LSTAT
Jul 21 12:57:25 xxx mount[17164]:   [00016]         STATUS       33bytes (19ms)
Jul 21 12:57:25 xxx mount[17164]: [00017] LSTAT
Jul 21 12:57:25 xxx mount[17164]:   [00017]         STATUS       33bytes (13ms)
Jul 21 12:57:25 xxx mount[17164]: [00018] LSTAT
Jul 21 12:57:25 xxx mount[17164]:   [00018]         STATUS       33bytes (14ms)
Jul 21 12:57:25 xxx mount[17164]: [00019] LSTAT
Jul 21 12:57:25 xxx mount[17164]:   [00019]         STATUS       33bytes (14ms)
Jul 21 12:57:25 xxx mount[17164]: [00020] LSTAT
Jul 21 12:57:25 xxx mount[17164]:   [00020]         STATUS       33bytes (14ms)
Jul 21 12:57:25 xxx mount[17164]: [00021] OPENDIR
Jul 21 12:57:25 xxx mount[17164]:   [00021]         HANDLE       17bytes (13ms)
Jul 21 12:57:25 xxx mount[17164]: [00022] READDIR
Jul 21 12:57:25 xxx mount[17164]: [00023] READDIR
Jul 21 12:57:25 xxx mount[17164]:   [00022]           NAME      527bytes (14ms)
Jul 21 12:57:25 xxx mount[17164]:   [00023]         STATUS       32bytes (14ms)
Jul 21 12:57:25 xxx mount[17164]: [00024] READDIR
Jul 21 12:57:25 xxx mount[17164]: [00025] READDIR
Jul 21 12:57:25 xxx mount[17164]: [00026] CLOSE
[...]
Jul 21 12:58:34 xxx mount[17164]: [00105] EXTENDED
Jul 21 12:58:34 xxx mount[17164]:   [00105] EXTENDED_REPLY       97bytes (15ms)
Jul 21 12:58:44 xxx systemd[1]: server.mount: Mounting timed out. Terminating.
Jul 21 12:58:44 xxx systemd[1]: server.mount: Mount process exited, code=killed, status=15/TERM
Jul 21 12:58:44 xxx systemd[1]: Mounted Server.
Jul 21 12:58:44 xxx mount[17164]: remote host has disconnected
Jul 21 12:58:44 xxx mount[17164]: sent:               105 messages, 3233 bytes
Jul 21 12:58:44 xxx mount[17164]: received:           105 messages, 21152 bytes
Jul 21 12:58:44 xxx mount[17164]: rtt min/max/avg:    12ms/35ms/16ms
Jul 21 12:58:44 xxx mount[17164]: num connect:        1
Jul 21 12:58:44 xxx systemd[1]: server.mount: Failed with result 'timeout'.

What could be the issue here?

Last edited by F43nd1r (2020-07-21 14:30:15)

Offline

#2 2020-07-21 11:34:14

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,267
Website

Re: [Solved] Timeout sshfs mount

Firstly, since the service depends on the SSH agent of a specific user, the service should be a user-unit.
This, however, would also mean, that the share has to be mounted to a mount point accessible by the user and possibly others, since you set allow_other.
If this sould be a system-wide service, you should move the respective SSH key to a location, only readable by root, e.g. /root/.ssh/sshfs.key and remove any possible passphrase from it to allow the service to use the keyfile on system startup (multi-user.target) without any user having to unlock the key via an SSH agent.
Also, Wants=network-online.target might not be sufficient and may create race conditions.
If you need internet access for this mount to work, also use After=network-online.target.


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#3 2020-07-21 11:49:09

F43nd1r
Member
Registered: 2019-09-04
Posts: 34

Re: [Solved] Timeout sshfs mount

Firstly, since the service depends on the SSH agent of a specific user, the service should be a user-unit.

I've tried to make it a user service, but ran into permission issues, so I configured it according to this post.
If it is possible to do this as a user service, great, but how?

This, however, would also mean, that the share has to be mounted to a mount point accessible by the user and possibly others, since you set allow_other.

Accessible mount point did not resolve the permission issues caused by running as a user service.

If this sould be a system-wide service, you should move the respective SSH key to a location, only readable by root, e.g. /root/.ssh/sshfs.key and remove any possible passphrase from it to allow the service to use the keyfile on system startup (multi-user.target) without any user having to unlock the key via an SSH agent.

You're right, my config wouldn't work on startup. Right now I'm just trying to get it working at all, and moving away from the ssh agent is not really a secure option.

Also, Wants=network-online.target might not be sufficient and may create race conditions.
If you need internet access for this mount to work, also use After=network-online.target.

Another issue with using on startup, but I just want to get it working when I start it manually. I'll get to startup when that's done. Also I think that line is unnecessary, as systemd automatically detects sshfs and adds network dependencies by default (found that out after I started the file).

Offline

#4 2020-07-21 12:16:56

progandy
Member
Registered: 2012-05-17
Posts: 5,280

Re: [Solved] Timeout sshfs mount

Have you tried setting e.g.

TimeoutSec=60

| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#5 2020-07-21 12:18:48

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,267
Website

Re: [Solved] Timeout sshfs mount

Considering the log, it's currently at 90 - the default. So why shorten it even more?

Last edited by schard (2020-07-21 12:20:38)


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#6 2020-07-21 12:21:52

progandy
Member
Registered: 2012-05-17
Posts: 5,280

Re: [Solved] Timeout sshfs mount

schard wrote:

Considering the log, it's currently at 90 - the default. So why shorten it even more?

Right. I somehow missed the increment in minutes.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#7 2020-07-21 12:37:26

F43nd1r
Member
Registered: 2019-09-04
Posts: 34

Re: [Solved] Timeout sshfs mount

I actually got to the same point when running as a user service after removing allow_other.

 [Unit]
Description=Server

[Mount]
What=xxx@xxx.com:/home/xxx
Where=/home/xxx/server
Type=fuse.sshfs
Options=noauto,_netdev,IdentityFile=/home/xxx/.ssh/id_rsa,reconnect,uid=1000,gid=1000,sshfs_debug
Environment=SSH_AUTH_SOCK=/run/user/1000/ssh-agent.socket

Logs look the same:

Jul 21 14:28:57 xxx systemd[839]: Mounting Server...
Jul 21 14:28:57 xxx mount[31405]: SSHFS version 3.7.0
Jul 21 14:28:57 xxx mount[31408]: executing <ssh> <-x> <-a> <-oClearAllForwardings=yes> <-oIdentityFile=/home/xxx/.ssh/id_rsa> <-2> <xxx@xxx.com> <-s> <sftp>
Jul 21 14:28:58 xxx mount[31405]: Server version: 3
Jul 21 14:28:58 xxx mount[31405]: Extension: posix-rename@openssh.com <1>
Jul 21 14:28:58 xxx mount[31405]: Extension: statvfs@openssh.com <2>
Jul 21 14:28:58 xxx mount[31405]: Extension: fstatvfs@openssh.com <2>
Jul 21 14:28:58 xxx mount[31405]: Extension: hardlink@openssh.com <1>
Jul 21 14:28:58 xxx mount[31405]: Extension: fsync@openssh.com <1>
Jul 21 14:28:58 xxx mount[31405]: Extension: lsetstat@openssh.com <1>
Jul 21 14:28:58 xxx mount[31405]: [00001] LSTAT
Jul 21 14:28:58 xxx mount[31405]: [00002] LSTAT
Jul 21 14:28:58 xxx mount[31405]:   [00001]         STATUS       33bytes (15ms)
Jul 21 14:28:58 xxx mount[31405]:   [00002]          ATTRS       41bytes (15ms)
Jul 21 14:28:58 xxx mount[31405]: [00003] LSTAT
Jul 21 14:28:58 xxx mount[31405]:   [00003]         STATUS       33bytes (17ms)
Jul 21 14:28:58 xxx mount[31405]: [00004] LSTAT
Jul 21 14:28:58 xxx mount[31405]:   [00004]         STATUS       33bytes (13ms)
Jul 21 14:28:58 xxx mount[31405]: [00005] LSTAT
Jul 21 14:28:58 xxx mount[31405]:   [00005]         STATUS       33bytes (16ms)
Jul 21 14:28:58 xxx mount[31405]: [00006] OPENDIR
Jul 21 14:28:58 xxx mount[31405]:   [00006]         HANDLE       17bytes (13ms)
Jul 21 14:28:58 xxx mount[31405]: [00007] READDIR
Jul 21 14:28:58 xxx mount[31405]: [00008] READDIR
Jul 21 14:28:58 xxx mount[31405]:   [00007]           NAME     1577bytes (15ms)
Jul 21 14:28:58 xxx mount[31405]:   [00008]         STATUS       32bytes (15ms)
Jul 21 14:28:58 xxx mount[31405]: [00009] READDIR
Jul 21 14:28:58 xxx mount[31405]: [00010] READDIR
Jul 21 14:28:58 xxx mount[31405]: [00011] LSTAT
Jul 21 14:28:58 xxx mount[31405]:   [00009]         STATUS       32bytes (22ms)
Jul 21 14:28:58 xxx mount[31405]:   [00010]         STATUS       32bytes (22ms)
Jul 21 14:28:58 xxx mount[31405]:   [00011]         STATUS       33bytes (22ms)
Jul 21 14:28:58 xxx mount[31405]: [00012] CLOSE
Jul 21 14:28:58 xxx mount[31405]: [00013] LSTAT
Jul 21 14:28:58 xxx mount[31405]: [00014] EXTENDED
Jul 21 14:28:58 xxx mount[31405]:   [00012]         STATUS       28bytes (21ms)
Jul 21 14:28:58 xxx mount[31405]:   [00013]         STATUS       33bytes (22ms)
Jul 21 14:28:58 xxx mount[31405]:   [00014] EXTENDED_REPLY       97bytes (17ms)
Jul 21 14:30:27 xxx systemd[839]: home-xxx-server.mount: Mounting timed out. Terminating.
Jul 21 14:30:27 xxx systemd[839]: home-xxx-server.mount: Mount process exited, code=killed, status=15/TERM
Jul 21 14:30:27 xxx mount[31405]: remote host has disconnected
Jul 21 14:30:27 xxx systemd[839]: Mounted Server.
Jul 21 14:30:27 xxx mount[31405]: sent:               14 messages, 389 bytes
Jul 21 14:30:27 xxx mount[31405]: received:           14 messages, 2054 bytes
Jul 21 14:30:27 xxx mount[31405]: rtt min/max/avg:    13ms/22ms/17ms
Jul 21 14:30:27 xxx mount[31405]: num connect:        1
Jul 21 14:30:27 xxx systemd[839]: home-xxx-server.mount: Failed with result 'timeout'.

Offline

#8 2020-07-21 12:41:09

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,267
Website

Re: [Solved] Timeout sshfs mount

It may be, that the ssh backend does not fork into the background, since you explicitely specified

ssh_command=ssh\040-F\040/home/xxx/.ssh/config

Try using

ssh_command=ssh\040-fF\040/home/xxx/.ssh/config

or

ssh_command=ssh\040-fnF\040/home/xxx/.ssh/config

Last edited by schard (2020-07-21 12:42:11)


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#9 2020-07-21 12:47:50

F43nd1r
Member
Registered: 2019-09-04
Posts: 34

Re: [Solved] Timeout sshfs mount

It may be, that the ssh backend does not fork into the background, since you explicitely specified

I've already removed that option in my user unit. I tested your options anyway, here's the log (both the same):

Jul 21 14:45:36 xxx systemd[839]: Mounting Server...
Jul 21 14:45:36 xxx mount[34020]: SSHFS version 3.7.0
Jul 21 14:45:36 xxx mount[34023]: executing <ssh> <-fnF> </home/xxx/.ssh/config> <-x> <-a> <-oClearAllForwardings=yes> <-oIdentityFile=/home/xxx/.ssh/id_rsa> <-2> <xxx@xxx.com> <-s> <sftp>
Jul 21 14:45:37 xxx mount[34020]: read: Connection reset by peer
Jul 21 14:45:37 xxx systemd[839]: home-xxx-server.mount: Mount process exited, code=exited, status=1/FAILURE
Jul 21 14:45:37 xxx systemd[839]: Mounted Server.

Offline

#10 2020-07-21 12:51:29

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,267
Website

Re: [Solved] Timeout sshfs mount

But this is another error.

Jul 21 14:45:37 xxx mount[34020]: read: Connection reset by peer

!=

Jul 21 14:30:27 xxx mount[31405]: remote host has disconnected

What happens, when you mount the SSHFS from the terminal?

Edit: Also this time you don't run into systemd's timeout.

Last edited by schard (2020-07-21 12:54:16)


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#11 2020-07-21 13:00:37

F43nd1r
Member
Registered: 2019-09-04
Posts: 34

Re: [Solved] Timeout sshfs mount

$ sshfs -o noauto,_netdev,reconnect,uid=1000,gid=1000,sshfs_debug xxx@xxx.com:/home/xxx/ /home/xxx/server/
SSHFS version 3.7.0
executing <ssh> <-x> <-a> <-oClearAllForwardings=yes> <-2> <xxx@xxx.com> <-s> <sftp>
Server version: 3
Extension: posix-rename@openssh.com <1>
Extension: statvfs@openssh.com <2>
Extension: fstatvfs@openssh.com <2>
Extension: hardlink@openssh.com <1>
Extension: fsync@openssh.com <1>
Extension: lsetstat@openssh.com <1>
[00001] LSTAT
[00002] LSTAT
  [00001]         STATUS       33bytes (15ms)
  [00002]          ATTRS       41bytes (14ms)
[00003] LSTAT
  [00003]         STATUS       33bytes (13ms)
[00004] LSTAT
  [00004]         STATUS       33bytes (16ms)
[00005] LSTAT
  [00005]         STATUS       33bytes (16ms)
[00006] OPENDIR
  [00006]         HANDLE       17bytes (15ms)
[00007] READDIR
[00008] READDIR
  [00007]           NAME     1577bytes (16ms)
  [00008]         STATUS       32bytes (16ms)
[00009] READDIR
[00010] READDIR
[00011] LSTAT
  [00009]         STATUS       32bytes (17ms)
  [00010]         STATUS       32bytes (17ms)
  [00011]         STATUS       33bytes (18ms)
[00012] CLOSE
[...]

Looks like this. Doesn't fork to the background, doesn't time out. Seems to work.

Offline

#12 2020-07-21 13:04:24

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,267
Website

Re: [Solved] Timeout sshfs mount

The point is, it should fork into the background.
Since it does not, systemd thinks that it's timing out.
Please provide:

$ type ssh
$ alias | grep ssh
$ ssh -V
$ sshfs -V

Last edited by schard (2020-07-21 13:19:04)


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#13 2020-07-21 13:05:46

F43nd1r
Member
Registered: 2019-09-04
Posts: 34

Re: [Solved] Timeout sshfs mount

$ type ssh
ssh is /usr/bin/ssh
$ alias | grep ssh
[no output]

Last edited by F43nd1r (2020-07-21 13:06:09)

Offline

#14 2020-07-21 13:06:52

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,267
Website

Re: [Solved] Timeout sshfs mount

Just checked. sshfs_debug prevents the forking. Remove it.


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#15 2020-07-21 13:13:57

progandy
Member
Registered: 2012-05-17
Posts: 5,280

Re: [Solved] Timeout sshfs mount

As I understand, sshfs requires ssh to run in the foreground so it can supervise it. sshfs itself should fork, though. (unless you use the -f option)
I just saw you use the option sshfs_debug. That will force sshfs to stay in the foreground as well, so remove it.

Edit: Much too slow.

Last edited by progandy (2020-07-21 13:14:34)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#16 2020-07-21 13:24:16

F43nd1r
Member
Registered: 2019-09-04
Posts: 34

Re: [Solved] Timeout sshfs mount

You're right, removing sshfs_debug helped. Now I'm seeing another issue: sshfs uses fusermount to mount, which works, but systemd uses umount to unmount, which doesn't work because a non-root user isn't allowed to umount. How can I tell systemd to use fusermount when stopping my unit?

Offline

#17 2020-07-21 13:26:43

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,267
Website

Re: [Solved] Timeout sshfs mount

Please provide the actual journal / output from the umount to see what's happening.


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#18 2020-07-21 13:31:31

F43nd1r
Member
Registered: 2019-09-04
Posts: 34

Re: [Solved] Timeout sshfs mount

$ systemctl --user stop home-xxx-server.mount   
Job failed. See "journalctl -xe" for details.
$ journalctl -xe
Hint: You are currently not seeing messages from other users and the system.
      Users in groups 'adm', 'systemd-journal', 'wheel' can see all messages.
      Pass -q to turn off this notice.
Jul 21 15:28:47 xxx systemd[839]: Unmounting Server...
-- Subject: A stop job for unit UNIT has begun execution
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- A stop job for unit UNIT has begun execution.
-- 
-- The job identifier is 863.
Jul 21 15:28:47 xxx umount[40601]: umount: /home/xxx/server: must be superuser to unmount.
Jul 21 15:28:47 xxx systemd[839]: home-xxx-server.mount: Mount process exited, code=exited, status=32/n/a
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- An n/a= process belonging to unit UNIT has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 32.
Jul 21 15:28:47 xxx systemd[839]: Failed unmounting Server.
-- Subject: A stop job for unit UNIT has finished
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- A stop job for unit UNIT has finished.
-- 
-- The job identifier is 863 and the job result is failed.

Offline

#19 2020-07-21 13:32:39

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,267
Website

Re: [Solved] Timeout sshfs mount

Did you change the unit from a system unit to a user unit yet?
If so, please post it as well.
Otherwise: Your original unit is not a user unit an thusly cannot be stopped in user mode.

Last edited by schard (2020-07-21 13:32:56)


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#20 2020-07-21 13:34:23

F43nd1r
Member
Registered: 2019-09-04
Posts: 34

Re: [Solved] Timeout sshfs mount

File is in ~/.config/systemd/user/home-xxx-server.mount

 [Unit]
Description=Server

[Mount]
What=xxx@xxx.com:/home/xxx
Where=/home/xxx/server
Type=fuse.sshfs
Options=noauto,_netdev,reconnect
Environment=SSH_AUTH_SOCK=/run/user/1000/ssh-agent.socket

Offline

#21 2020-07-21 13:35:15

progandy
Member
Registered: 2012-05-17
Posts: 5,280

Re: [Solved] Timeout sshfs mount

Since v2.34 libmount / umount should support unmounting fuse filesystems of the calling user.
https://github.com/karelzak/util-linux/ … 239f68c30a

Last edited by progandy (2020-07-21 13:35:48)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#22 2020-07-21 13:35:24

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,267
Website

Re: [Solved] Timeout sshfs mount

Looks okay.
How did you start the unit?
You also need to start it in user mode:

$ systemctl start --user <unit>

Last edited by schard (2020-07-21 13:36:43)


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#23 2020-07-21 13:43:09

F43nd1r
Member
Registered: 2019-09-04
Posts: 34

Re: [Solved] Timeout sshfs mount

Here are my steps (after a reboot)

$ systemctl --user status home-xxx-server.mount
● home-xxx-server.mount - Server
     Loaded: loaded (/home/xxx/.config/systemd/user/home-xxx-server.mount; static; vendor preset: enabled)
     Active: inactive (dead)
TriggeredBy: ● home-xxx-server.automount
      Where: /home/xxx/server
       What: xxx@xxx.com:/home/xxx
$ systemctl --user start home-xxx-server.mount
$ systemctl --user stop home-xxx-server.mount
Job failed. See "journalctl -xe" for details.
$ systemctl --user status home-xxx-server.mount
● home-xxx-server.mount - Server
     Loaded: loaded (/home/xxx/.config/systemd/user/home-xxx-server.mount; static; vendor preset: enabled)
     Active: active (mounted) (Result: exit-code) since Tue 2020-07-21 15:40:53 CEST; 8s ago
TriggeredBy: ● home-xxx-server.automount
      Where: /home/xxx/server
       What: xxx@xxx.com:/home/xxx
     CGroup: /user.slice/user-1000.slice/user@1000.service/home-xxx-server.mount
             ├─2584 ssh -x -a -oClearAllForwardings=yes -2 xxx@xxx.com -s sftp
             └─2589 /usr/bin/mount.fuse.sshfs xxx@xxx.com:/home/xxx /home/xxx/server -o rw,reconnect,_netdev

Jul 21 15:40:45 xxx systemd[829]: Mounting Server...
Jul 21 15:40:46 xxx systemd[829]: Mounted Server.
Jul 21 15:40:53 xxx systemd[829]: Unmounting Server...
Jul 21 15:40:53 xxx umount[2616]: umount: /home/xxx/server: must be superuser to unmount.
Jul 21 15:40:53 xxx systemd[829]: home-xxx-server.mount: Mount process exited, code=exited, status=32/n/a
Jul 21 15:40:53 xxx systemd[829]: Failed unmounting Server.

Offline

#24 2020-07-21 13:50:07

F43nd1r
Member
Registered: 2019-09-04
Posts: 34

Re: [Solved] Timeout sshfs mount

progandy wrote:

Since v2.34 libmount / umount should support unmounting fuse filesystems of the calling user.
https://github.com/karelzak/util-linux/ … 239f68c30a

$ umount -V
umount from util-linux 2.35.2 (libmount 2.35.2: btrfs, namespaces, assert, debug)

Offline

#25 2020-07-21 13:59:27

F43nd1r
Member
Registered: 2019-09-04
Posts: 34

Re: [Solved] Timeout sshfs mount

Seems like there is an open bug for this issue https://bugs.freedesktop.org/show_bug.cgi?id=73809. I think I'll have to convert my mount into a service for now.

Offline

Board footer

Powered by FluxBB