changeset 328:8558ea135812

fix dnsmasq startup ordering
author drewp@bigasterisk.com
date Sun, 23 Feb 2025 15:08:14 -0800
parents e796f5776e57
children 2bbcf00b8d2a
files dns/files/dnsmasq-mtail.service dns/files/dnsmasq_exporter.service dns/templates/dnsmasq/dnsmasq.service.j2 dnsmasq_exporter.service net/files/house_net.service
diffstat 5 files changed, 20 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/dns/files/dnsmasq-mtail.service	Mon Jan 20 21:57:15 2025 -0800
+++ b/dns/files/dnsmasq-mtail.service	Sun Feb 23 15:08:14 2025 -0800
@@ -2,10 +2,10 @@
 
 [Unit]
 Description=dnsmasq-mtail for 10.2 network
-After=dnsmasq_10.2.service
+BindsTo=dnsmasq_10.2.service
 
 [Service]
-Type=simple
+Type=exec
 
 ExecStart=zsh /opt/dnsmasq/10.2/run_mtail.sh
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dns/files/dnsmasq_exporter.service	Sun Feb 23 15:08:14 2025 -0800
@@ -0,0 +1,15 @@
+unused?
+
+# written by pyinfra
+
+[Unit]
+Description=send updated leases to dnsmasq_exporter
+After=dnsmasq_10.2.service
+
+[Service]
+Type=simple
+
+ExecStart=zsh -c 'print /opt/dnsmasq/10.2/leases | entr curl http://10.5.0.7:9998/leases -H "content-type: text/plain" -d "@/opt/dnsmasq/10.2/leases"'
+
+[Install]
+WantedBy=multi-user.target
--- a/dns/templates/dnsmasq/dnsmasq.service.j2	Mon Jan 20 21:57:15 2025 -0800
+++ b/dns/templates/dnsmasq/dnsmasq.service.j2	Sun Feb 23 15:08:14 2025 -0800
@@ -7,24 +7,19 @@
 Requires=network-online.target
 Requires=sys-subsystem-net-devices-eth1.device
 
+# this seems wrong but systemd is doing the right thing with it, for now
 Wants=nss-lookup.target
 Before=nss-lookup.target
-After=network.target
 
 # startup order has to be like this:
 #    dnsmasq_10.2
 #    wg-quick@wg0.service
-#    dnsmasq_10.5
 {% if net == '10.2' %}
-Before=wg-quick@wg0.service
 After=house_net.service
 {% endif %}
-{% if net == '10.5' %}
-Requires=wg-quick@wg0.service
-{% endif %}
 
 [Service]
-Type=simple
+Type=exec
 
 # 10.5 will not work until wg0 interface is actually up, so just let it retry
 # but i think this next line was not the right way to retry.
--- a/dnsmasq_exporter.service	Mon Jan 20 21:57:15 2025 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-unused?
-
-# written by pyinfra
-
-[Unit]
-Description=send updated leases to dnsmasq_exporter
-After=dnsmasq_10.2.service
-
-[Service]
-Type=simple
-
-ExecStart=zsh -c 'print /opt/dnsmasq/10.2/leases | entr curl http://10.5.0.7:9998/leases -H "content-type: text/plain" -d "@/opt/dnsmasq/10.2/leases"'
-
-[Install]
-WantedBy=multi-user.target
--- a/net/files/house_net.service	Mon Jan 20 21:57:15 2025 -0800
+++ b/net/files/house_net.service	Sun Feb 23 15:08:14 2025 -0800
@@ -1,8 +1,7 @@
 # written by pyinfra
 
 [Unit]
-After=network-online.target nss-lookup.target
-Wants=network-online.target nss-lookup.target
+After=network-online.target
 
 [Service]
 Type=oneshot