]> git.proxmox.com Git - pve-network.git/commitdiff
install dnsmasq@.service snippet
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 22 Nov 2023 13:22:13 +0000 (14:22 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 22 Nov 2023 13:37:39 +0000 (14:37 +0100)
To
- start after networking.service (in order to make sure ifupdown has
  created all the interfaces before dnsmasq tries to find them via the
  'interfaces=' lines.
- drop the 'Requires=network.target' since it is not a *provider* of
  that target

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/Makefile
src/services/00-dnsmasq-after-networking.conf [new file with mode: 0644]
src/services/Makefile [new file with mode: 0644]

index 36f90db202a5b76fe34434143239a5d7d76b3acb..c9dee4c3cf10fc4c13600241f6aeeb682a4e0524 100644 (file)
@@ -1,10 +1,12 @@
+SUBDIRS := PVE services
+
 all:
-       $(MAKE) -C PVE
+       set -e && for i in $(SUBDIRS); do $(MAKE) -C $$i; done
 
 .PHONY: clean
 clean:
        $(MAKE) -C test $@
-       $(MAKE) -C PVE $@
+       set -e && for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done
 
 .PHONY: test
 test:
@@ -12,4 +14,4 @@ test:
 
 .PHONY: install
 install:
-       $(MAKE) -C PVE $@
+       set -e && for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done
diff --git a/src/services/00-dnsmasq-after-networking.conf b/src/services/00-dnsmasq-after-networking.conf
new file mode 100644 (file)
index 0000000..f8b825b
--- /dev/null
@@ -0,0 +1,12 @@
+# dnsmasq@.service comes with
+#    Requires=network.target
+#    After=network.target
+# Only the After entry makes sense as `network.target` is a passive rule and
+# `Require`ing it means that dnsmasq is the "provider" of that unit.
+# See https://systemd.io/NETWORK_ONLINE
+#
+# Additionally, we want ifupdown to have completed its setup, to make sure
+# the 'interface=' directives can find the required interfaces at startup.
+[Unit]
+Requires=
+After=networking.service
diff --git a/src/services/Makefile b/src/services/Makefile
new file mode 100644 (file)
index 0000000..818c106
--- /dev/null
@@ -0,0 +1,14 @@
+SERVICEDIR=$(DESTDIR)/lib/systemd/system
+
+all:
+       @true
+
+.PHONY: install
+install:
+       install -d $(SERVICEDIR)
+       install -d $(SERVICEDIR)/dnsmasq@.service.d
+       install -t $(SERVICEDIR)/dnsmasq@.service.d -m 0644 00-dnsmasq-after-networking.conf
+
+.PHONY: clean
+clean:
+       @true