Add a sample systemd service for dhcpcd-online. dhcpcd-ui-0.7.0
authorRoy Marples <roy@marples.name>
Tue, 16 Sep 2014 20:44:34 +0000 (20:44 +0000)
committerRoy Marples <roy@marples.name>
Tue, 16 Sep 2014 20:44:34 +0000 (20:44 +0000)
mk/prog.mk
src/dhcpcd-online/Makefile
src/dhcpcd-online/dhcpcd-wait-online.service.in [new file with mode: 0644]

index 18679d4fdfefa10401570008c031e5acf8583610..25eebd0e9e0c444d9db754ee512f0034d4f23498 100644 (file)
@@ -6,7 +6,7 @@
 SRCS?=         ${PROG}.c
 OBJS+=         ${SRCS:.c=.o}
 
-all: ${PROG} ${SCRIPTS}
+all: ${PROG} ${SCRIPTS} ${FILES}
 
 .c.o:
        ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@
index 6881899fea4b660c825810c30abc2a77d3fb1baf..a7875b5aa2e112a6c8a927275edf4ab87b7551d8 100644 (file)
@@ -12,5 +12,13 @@ CPPFLAGS+=   -I${TOPDIR}
 
 LDADD+=                ${LIB_DHCPCD} ${LIB_INTL}
 
+FILES=         dhcpcd-wait-online.service
+CLEANFILES+=   ${FILES}
+
+.SUFFIXES:     .in
+
+.in:
+       ${SED} -e 's:@BINDIR@:${BINDIR}:g' $< > $@
+
 include ../libdhcpcd/Makefile.inc
 include ${MKDIR}/prog.mk
diff --git a/src/dhcpcd-online/dhcpcd-wait-online.service.in b/src/dhcpcd-online/dhcpcd-wait-online.service.in
new file mode 100644 (file)
index 0000000..a27f638
--- /dev/null
@@ -0,0 +1,13 @@
+[Unit]
+Description=dhcpcd Wait Online
+Requisite=dhcpcd.service
+After=dhcpcd.service
+Wants=network.target
+Before=network.target network-online.target
+
+[Service]
+Type=oneshot
+ExecStart=@BINDIR@/dhcpcd-online -q
+
+[Install]
+WantedBy=multi-user.target