Web lists-archives.com

Re: bind9 startup problems: /var/cache /bind




On 23/05/19 9:08 AM, Ross Boylan wrote:
> /var is a separate file system, and like / it's encrypted, so it might
> take a bit of time to activate it.  Whether it's available when
> needed, I don't know, though the error suggests it might not be.
> Could systemd be launching services while some of the mounts (and the
> required decryption) are still to be done?
> 
> Is there some systemd way to ensure the file system is mounted before
> launching bind?  But I'd think if /var weren't available, bind
> wouldn't be the only one with a problem.

Well, I don't see anything in bind9.service to prevent it starting. I'm
not sure what the best dependency is ...

A bit of web searching finds:
https://unix.stackexchange.com/questions/246935/set-systemd-service-to-execute-after-fstab-mount

... which suggests:
RequiresMountsFor=/absolute/path/of/mount

.. to go in the unit file - or IIRC running:

sudo systemctl edit bind9.service

... and putting in:

-------8<--------
[Unit]
RequiresMountsFor=/var
-------8<--------

... followed by:
sudo systemctl daemon-reload

Not tested.

Cheers,
Richard

Attachment: signature.asc
Description: OpenPGP digital signature