[systemd-devel] NFS mount unit

Colin Guthrie gmane at colin.guthr.ie
Sat Feb 16 04:05:20 PST 2013

'Twas brillig, and Patrick Donnelly at 15/02/13 20:44 did gyre and gimble:
> I am trying to setup a mount unit file for an NFS mount. I'm using
> (with IP address hidden):
> # cat host\@.mount
> [Unit]
> Description=%i mount
> DefaultDependencies=no
> Requires=local-fs.target network.target rpc-statd.service
> Conflicts=umount.target
> [Mount]
> What=host:/%i
> Where=/%i
> Type=nfs
> Options=user,async,atime,exec,rw,wsize=32768,rsize=32768
> DirectoryMode=0755
> TimeoutSec=20
> [Install]
> WantedBy=multi-user.target
> When trying to enable the mount unit, I get this error:
> # systemctl enable ./host\@mnt.mount
> Failed to issue method call: Invalid argument

Don't use the paths ./ as a prefix.

Just ensure your unit is located in /etc/systemd/system and do:

systemctl enable host at mnt.mount

No need to escape anything.

> This error message is unfortunately (and frustratingly) vague. What am
> I doing wrong?
> [Before someone asks why not use /etc/fstab, I'm planning to add an
> openvpn dependency when I get these issues sorted out.]

Can't you just make openvpn.service also part of network.target? Thus
holding up network.target until after it's started and thus delaying the
mount until that point (even when the mount is generated from fstab).

Alternatively, would it make sense to teach the fstab generator some
kind of x-system-* option (or comment= syntax) to allow -after or
-requires deps to be specified.



Colin Guthrie

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/

More information about the systemd-devel mailing list