You are not logged in.

#26 2020-07-21 14:03:12

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

Re: [Solved] Timeout sshfs mount

https://www.freedesktop.org/software/systemd/man/systemd.mount.html#Description wrote:

Note that the options User= and Group= are not useful for mount units. systemd passes two parameters to mount(8); the values of What= and Where=. When invoked in this way, mount(8) does not read any options from /etc/fstab, and must be run as UID 0.

This sounds like user mount units are currently not supported by systemd.
Sorry for that, I didn't know this before, since I never used mount units on user-level.
You can, however, translate your unit from a mount unit to a service unit with ExecStart doing the FUSE mounting and ExecStop doing the fusermount .

Edit: Too slow.

Last edited by schard (2020-07-21 14:04:17)


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#27 2020-07-21 14:08:39

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

Re: [Solved] Timeout sshfs mount

F43nd1r wrote:

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.

That bug is for mounting and that works now. Your problem is with unmounting.

Since v2.35 mount allows fuse with options for non-root mounts https://github.com/systemd/systemd/issues/13741
https://github.com/karelzak/util-linux/ … fd14532200

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


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

Offline

#28 2020-07-21 14:19:54

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

Re: [Solved] Timeout sshfs mount

Using mounts would've been nice, as it would've allowed me to use automount.

Anyway, here is my service. Does this look like a suitable replacement?

[Unit]
Description=Server Mount
Wants=network-online.target
After=network-online.target
Before=umount.target
Conflicts=umount.target

[Service]
Type=forking
ExecStart=sshfs -o _netdev,reconnect xxx@xxx.com:/home/xxx/ /home/xxx/server/
ExecStop=fusermount -uz /home/xxx/server/


[Install]
WantedBy=default.target

Offline

#29 2020-07-21 14:26:19

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

Re: [Solved] Timeout sshfs mount

Looks good. If it works, it works.


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

Board footer

Powered by FluxBB