summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-containers/cni-plugins/files/cni-dhcp.initd')
-rw-r--r--app-containers/cni-plugins/files/cni-dhcp.initd20
1 files changed, 20 insertions, 0 deletions
diff --git a/app-containers/cni-plugins/files/cni-dhcp.initd b/app-containers/cni-plugins/files/cni-dhcp.initd
new file mode 100644
index 000000000000..26b838c516bd
--- /dev/null
+++ b/app-containers/cni-plugins/files/cni-dhcp.initd
@@ -0,0 +1,20 @@
+#!/sbin/openrc-run
+
+name="CNI-DHCP"
+description="virtual dhcp server for containers"
+command="/opt/cni/bin/dhcp"
+command_args="daemon"
+command_background=true
+pidfile="/run/${RC_SVCNAME}.pid"
+
+depend() {
+ need net
+}
+
+stop_post() {
+ if [ -e /run/cni/dhcp.sock ]; then
+ ebegin "Cleaning socket for ${name}"
+ rm -f /run/cni/dhcp.sock
+ eend $? "Failed to cleanup socket"
+ fi
+}