[systemd-devel] Mount units with After=autofs.service cause ordering cycles

Lennart Poettering lennart at poettering.net
Thu Oct 31 17:08:34 UTC 2019


On Mo, 14.10.19 16:23, John Florian (john at doubledog.org) wrote:

> 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:
>
> ~~~
>
> # /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
>
> ~~~
>
> 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?

What precisely is the ordering cycle you are seeing? It's usually
dumped along with the log message.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list