This is an extension to an older blog post on how to mount WebDAV share using systemd as this proved to be a very reliable method that is easy to mark as a dependency for other services.

Install nfs-common package to mount NFS share.

$ sudo apt-get install nfs-common

Create a mount directory.

$ sudo mkdir /mnt/usr-export-from-main-server

Escape mount directory name so it can be used to name the systemd unit file.

$ systemd-escape /mnt/usr-export-from-main-server

Verify that the unit name will match the mount path.

$ systemd-escape --unescape --path  'mnt-usr\x2dexport\x2dfrom\x2dmain\x2dserver'

Create a systemd mount unit configuration.

$ cat << EOF | sudo tee '/etc/systemd/system/mnt-usr\x2dexport\x2dfrom\x2dmain\x2dserver.mount'
Description=Mount NFS share



Reload systemd manager configuration.

$ sudo systemctl daemon-reload

Enable the mount service at boot time.

$ sudo systemctl enable 'mnt-usr\x2dexport\x2dfrom\x2dmain\x2dserver.mount'

Start the mount service right away.

$ sudo systemctl start 'mnt-usr\x2dexport\x2dfrom\x2dmain\x2dserver.mount'

Finally, check service status.

$ sudo systemctl status 'mnt-usr\x2dexport\x2dfrom\x2dmain\x2dserver.mount'
● mnt-usr\x2dexport\x2dfrom\x2dmain\x2dserver.mount - Mount NFS share
   Loaded: loaded (/etc/systemd/system/mnt-usr\x2dexport\x2dfrom\x2dmain\x2dserver.mount; enabled; vendor preset: enabled)
   Active: active (mounted) since Tue 2019-06-04 21:59:47 GMT; 4min 5s ago
    Where: /mnt/usr-export-from-main-server
    Tasks: 0 (limit: 394)
   Memory: 364.0K
   CGroup: /system.slice/mnt-usr\x2dexport\x2dfrom\x2dmain\x2dserver.mount

Jun 04 21:59:45 buster systemd[1]: Mounting Mount NFS share...
Jun 04 21:59:47 buster systemd[1]: Mounted Mount NFS share.