On 2021-07-29 10:54:11 +0200, Daniele Nicolodi wrote:
> On 29/07/2021 00:17, Vincent Lefevre wrote:
> > On 2021-07-28 16:49:20 -0400, Wietse Venema wrote:
> >> Thanks. I agree, Postfix should start up after the network is fully
> >> initialized. That includes all the network interfaces, and all the
> >> network infrastructure services.
> > 
> > And the disks are mounted. On my Debian server, I had to add a
> > /etc/systemd/system/postfix@.service.d/data-disk.conf file with
> > 
> > [Service]
> > ExecStartPre=/bin/sh -c 'while [ ! -d /srv/d_joooj/home ]; do sleep 5; done'
> > TimeoutStartSec=300
> > 
> > Otherwise mail was rejected after some reboots.
> > 
> > I don't know whether this is the right solution, but at least, this
> > solved my problem.
> 
> What you probably want is
> 
> RequiresMountsFor=/srv/d_joooj/home
> 
> https://www.freedesktop.org/software/systemd/man/systemd.unit.html#RequiresMountsFor=
> 
> if your service requires files in a volume that for some reason is not
> mounted as part of local-fs.target.

No, this was the first thing I tried in order to solve the issue[*],
but unfortunately this didn't have any effect: it doesn't seem to work
with on-demand automount.

[*] I actually did the test with apache, which happens to be more
sensitive to the race condition, but the same thing could happen
with postfix.

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Reply via email to