[systemd-devel] cannot create hard dependencies on mounts

Lennart Poettering lennart at poettering.net
Wed Sep 11 16:09:21 UTC 2024


On Di, 10.09.24 15:37, Henti Smith (henti at gaydonsmith.co.uk) wrote:

> Good day all.
>
> I have a service that requires a disk, which is mounted via NFS.
>
> I've used data.mount to mount the NFS as follows:
> [Unit]
> Description=Mount Data
>
> [Mount]
> What=192.168.60.10:/mnt/ta_data
> Where=/data
> Type=nfs
> Options=vers=4,_netdev,auto
>
> [Install]
> WantedBy=multi-user.target

remote mounts should usually be hooked into remote-fs.target.

> and then the service is managed with mission.service:
> [Unit]
> Description=Mission Control
> After=network.target data.mount
> Wants=network.target

You really should add Wants=data.mount or Requires=data.mount
otherwise, since otherwise you might start this service and not pull
in the mount.

> I'm not entirely sure why this happens.

please provide debug logs of this transaction. i.e. "systemd-analyze
log-level debug" and then reproduce the issue. and provide the
logs. This will then show the transactions generated and what is being
waited for.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list