How to ensure the dnsmaq log network share location exists before the dnsmasq service starts up?

20 Views Asked by At

I have autofs mounting a network share on demand, and dnsmasq providing DNS to my local network. dnsmasq is set to write logs to the network share. On reboot the share doesnt seem to be set up before the dnsmasq service starts, so dnsmasq gives up on writing logs until its restarted, when it then write logs just fine. So I need some method to ensure the network share is set up before dnsmasq itself starts up.

1

There are 1 best solutions below

0
Cam Graham On

Answering my own question - edit the systemd startup service definition files for dnsmasq and autofs, adding Requires and After/Before statements to ensure dnsmasq doesnt start until autofs does. Can verify this with

$ systemd-analyze plot