You are not logged in.

#1 2015-10-09 00:44:17

bond
Member
From: Melbourne, Australia
Registered: 2009-05-05
Posts: 62

systemd --user mounts for sshfs and encfs

Hello,

I want to leverage systemd automounting under systemd --user for sshfs and encfs mounts

I'd like to have the configuration stored in $HOME
The users ssh keys are used for sshfs
The users keyring stores encfs keys

The encfs mounts depend on the sshfs mount

psuedo units;

# ~/.config/systemd/user/sshfs.mount
[Unit]
Description=sshfs mount
Requires=network-online.service
After=network-online.service

[Mount]
What=192.168.1.x:/example
Where=$HOME/mnt/example
Type=sshfs

[Install]
WantedBy=multi-user.target

# ~/.config/systemd/user/sshfs.automount
[Automount]
Where=$HOME/mnt/example

# ~/.config/systemd/user/encfs.service
[Unit]
Description=encfs mount
Requires=sshfs.mount

[Service]
Type=oneshot
ExecStart=/usr/bin/encfs $HOME/mnt/example/encrypted $HOME/mnt/encrypted

I realize fuse systems (that don't specfically use `mount` as a command, won't work for systemd .mount units)
I'm unsure if there's any way to have a systemd --user .service unit fire when a directory is accessed?
Or associated a .automount and a .service?

Any hints?

Offline

Board footer

Powered by FluxBB