summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile19
-rw-r--r--dns-ready-check.service12
-rw-r--r--dns-ready.target4
3 files changed, 35 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..d26ccb9
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,19 @@
+DESTDIR=
+PREFIX=/usr/local
+LIBDIR=$(PREFIX)/lib
+SYSDDIR=$(LIBDIR)/systemd/system
+
+
+all:
+ @echo no-op
+
+
+install:
+ install -m644 -Dt $(DESTDIR)$(SYSDDIR) dns-ready{-check.service,.target}
+
+
+uninstall:
+ rm -f $(DESTDIR)$(SYSDDIR)/dns-ready{-check.service,.target}
+
+
+.PHONY: all install uninstall
diff --git a/dns-ready-check.service b/dns-ready-check.service
new file mode 100644
index 0000000..a945739
--- /dev/null
+++ b/dns-ready-check.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Check if Domain Name System resolver is ready
+DefaultDependencies=no
+Requires=network-online.target
+After=network-online.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/host example.com
+Restart=on-failure
+RestartSec=1
+StandardOutput=null
diff --git a/dns-ready.target b/dns-ready.target
new file mode 100644
index 0000000..44b21c8
--- /dev/null
+++ b/dns-ready.target
@@ -0,0 +1,4 @@
+[Unit]
+Description=Domain Name System resolver is ready
+Requires=dns-ready-check.service
+After=dns-ready-check.service