summaryrefslogtreecommitdiff
blob: 26b838c516bd53cc7ae429a7fce5f4d2a2b16739 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
}