<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>So, I much prefer the expressiveness of systemd's mount units to
the naive era of /etc/fstab, but I've found one situation where I
seem to always get stuck and am never able to find a reliable
solution that survives OS (Fedora & CentOS) updates. I have a
NFS filesystem mounted by autofs at /pub that needs to be bind
mounted in various places such as /var/www/pub and /var/ftp/pub.
So I create a unit that looks like:</p>
<p>~~~</p>
<pre># /etc/systemd/system/var-www-pub.mount
[Unit]
Description=mount /pub served via httpd
Requires=autofs.service
After=autofs.service
[Mount]
What=/mnt/pub
Where=/var/www/pub
Options=bind,context=system_u:object_r:httpd_sys_content_t
[Install]
WantedBy=multi-user.target</pre>
<p>~~~</p>
<p>The above worked for a long time, but once again a `dnf upgrade`
seems to have broken things because now I have a ordering cycle
that systemd must break. Since I haven't changed my mount units,
my ability to mesh with those shipped by the OS proves fragile.
I'm deliberately avoiding too much detail here because it would
seem that there should be a relatively simple solution to this
general sort of task -- I just can't seem to discover it. Any
recommendations that don't involve an entirely different approach?</p>
</body>
</html>