Add systemd unit file to activate socket with systemd

This changes to add sample systemd unit files to activate socket
with systemd. Fix #156.
This commit is contained in:
Tomofumi Hayashi 2019-03-14 16:03:23 +09:00
parent afd7391938
commit b1814d7f9a
2 changed files with 25 additions and 0 deletions

View File

@ -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

View File

@ -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