Skip to content

Instantly share code, notes, and snippets.

@TBK
Created November 23, 2023 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TBK/4e6434ded8f48aadc9e222afb9eac94b to your computer and use it in GitHub Desktop.
Save TBK/4e6434ded8f48aadc9e222afb9eac94b to your computer and use it in GitHub Desktop.
#!/sbin/openrc-run
name="CNI DHCP"
description="CNI DHCP service"
command="/usr/libexec/cni/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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment