summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2014-09-16 20:44:34 +0000
committerRoy Marples <roy@marples.name>2014-09-16 20:44:34 +0000
commit3d670660d0d590516e758f59206a27bb31c5006f (patch)
treeb62ae0b0dfff129b84093f8b7221d4617de19102
parent06d4289ebde12b8b494452b59ca1479043f57407 (diff)
Add a sample systemd service for dhcpcd-online.dhcpcd-ui-0.7.0
-rw-r--r--mk/prog.mk2
-rw-r--r--src/dhcpcd-online/Makefile8
-rw-r--r--src/dhcpcd-online/dhcpcd-wait-online.service.in13
3 files changed, 22 insertions, 1 deletions
diff --git a/mk/prog.mk b/mk/prog.mk
index 18679d4..25eebd0 100644
--- a/mk/prog.mk
+++ b/mk/prog.mk
@@ -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 $@
diff --git a/src/dhcpcd-online/Makefile b/src/dhcpcd-online/Makefile
index 6881899..a7875b5 100644
--- a/src/dhcpcd-online/Makefile
+++ b/src/dhcpcd-online/Makefile
@@ -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
index 0000000..a27f638
--- /dev/null
+++ b/src/dhcpcd-online/dhcpcd-wait-online.service.in
@@ -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