Skip to content

Commit

Permalink
Merge pull request containernetworking#276 from s1061123/dev/add-dhcp…
Browse files Browse the repository at this point in the history
…-systemd-file

Add systemd unit file to activate socket with systemd
  • Loading branch information
dcbw committed Mar 27, 2019
2 parents 82a0651 + b1814d7 commit f55d8d0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
11 changes: 11 additions & 0 deletions plugins/ipam/dhcp/systemd/cni-dhcp.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=CNI DHCP service
Documentation=https://github.com/containernetworking/plugins/tree/master/plugins/ipam/dhcp
After=network.target cni-dhcp.socket
Requires=cni-dhcp.socket

[Service]
ExecStart=/opt/cni/bin/dhcp daemon

[Install]
WantedBy=multi-user.target
14 changes: 14 additions & 0 deletions plugins/ipam/dhcp/systemd/cni-dhcp.socket
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=CNI DHCP service socket
Documentation=https://github.com/containernetworking/plugins/tree/master/plugins/ipam/dhcp
PartOf=cni-dhcp.service

[Socket]
ListenStream=/run/cni/dhcp.sock
SocketMode=0660
SocketUser=root
SocketGroup=root
RemoveOnStop=true

[Install]
WantedBy=sockets.target

0 comments on commit f55d8d0

Please sign in to comment.