parent
1865a0701e
commit
4ec62ac295
@ -18,7 +18,7 @@ $ ./dhcp daemon
|
||||
|
||||
If given `-pidfile <path>` arguments after 'daemon', the dhcp plugin will write
|
||||
its PID to the given file.
|
||||
If given `-hostprefix <prefix>` arguments after 'daemon', the dhcp plugin will use this prefix for netns as `<prefix>/<original netns>`. It could be used in case of running dhcp daemon as container.
|
||||
If given `-hostprefix <prefix>` arguments after 'daemon', the dhcp plugin will use this prefix for DHCP socket as `<prefix>/run/cni/dhcp.sock`. It could be used in case of running dhcp daemon as container.
|
||||
|
||||
Alternatively, you can use systemd socket activation protocol.
|
||||
Be sure that the .socket file uses /run/cni/dhcp.sock as the socket path.
|
||||
|
@ -172,7 +172,7 @@ func runDaemon(pidfilePath string, hostPrefix string, socketPath string) error {
|
||||
}
|
||||
}
|
||||
|
||||
l, err := getListener(socketPath)
|
||||
l, err := getListener(hostPrefix + socketPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error getting listener: %v", err)
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ func main() {
|
||||
var socketPath string
|
||||
daemonFlags := flag.NewFlagSet("daemon", flag.ExitOnError)
|
||||
daemonFlags.StringVar(&pidfilePath, "pidfile", "", "optional path to write daemon PID to")
|
||||
daemonFlags.StringVar(&hostPrefix, "hostprefix", "", "optional prefix to netns")
|
||||
daemonFlags.StringVar(&hostPrefix, "hostprefix", "", "optional prefix to host root")
|
||||
daemonFlags.StringVar(&socketPath, "socketpath", "", "optional dhcp server socketpath")
|
||||
daemonFlags.Parse(os.Args[2:])
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user