Closed erotel closed 4 years ago
@erotel it looks like you built Kea 1.2.0 yourself. Did you build the hook against Kea 1.1.0 from the Debian package or against your local Kea 1.2.0 install?
See the README, you may need to set environment variables KEA_INCLUDE
, KEA_LIB
and KEA_MSG_COMPILER
to point to your Kea installation.
Im build from local Kea 1.2.0.
KEA_MSG_COMPILER = ~/kea/src/lib/log/compiler/kea-msg-compiler
KEA_INCLUDE = ~/kea/src/lib
KEA_LIB = /usr/local/lib
Ok, I haven't tested with Kea 1.2.0 in a while, I will give it a try at some point.
Can you maybe try with Kea 1.3.0, which was just released?
root@ipv6-dhcp-test:~/kea-hook-runscript-master# /usr/local/sbin/kea-dhcp6 -c /root/kea-config/kea-test2.conf
2017-10-31 19:22:27.848 INFO [kea-dhcp6.dhcp6/28662] DHCP6_STARTING Kea DHCPv6 server version 1.3.0 starting
2017-10-31 19:22:27.849 ERROR [kea-dhcp6.hooks/28662] HOOKS_INCORRECT_VERSION hook library /usr/local/lib/kea-hook-runscript.so is at version 4, require version 5
2017-10-31 19:22:27.850 ERROR [kea-dhcp6.dhcp6/28662] DHCP6_PARSER_FAIL failed to create or run parser for configuration element hooks-libraries: hooks libraries failed to validate - library or libraries in error are: /usr/local/lib/kea-hook-runscript.so(/root/kea-config/kea-test2.conf:9:3)
2017-10-31 19:22:27.850 ERROR [kea-dhcp6.dhcp6/28662] DHCP6_CONFIG_LOAD_FAIL configuration error using file: /root/kea-config/kea-test2.conf, reason: hooks libraries failed to validate - library or libraries in error are: /usr/local/lib/kea-hook-runscript.so(/root/kea-config/kea-test2.conf:9:3)
2017-10-31 19:22:27.850 ERROR [kea-dhcp6.dhcp6/28662] DHCP6_INIT_FAIL failed to initialize Kea server: configuration error using file '/root/kea-config/kea-test2.conf': hooks libraries failed to validate - library or libraries in error are: /usr/local/lib/kea-hook-runscript.so(/root/kea-config/kea-test2.conf:9:3)
root@ipv6-dhcp-test:~/kea-hook-runscript-master# cat /root/kea-config/kea-test2.conf
{
"Dhcp6": {
"renew-timer": 100,
"rebind-timer": 200,
"preferred-lifetime": 300,
"valid-lifetime": 400,
"hooks-libraries": [
{
"library": "/usr/local/lib/kea-hook-runscript.so",
"parameters": {
"script": "/root/bebug.sh"
}
}
],
"lease-database": {
"type": "memfile",
"persist": true,
"name": "/tmp/kea-leases6.csv",
"lfc-interval": 1800
},
"interfaces-config": {
"interfaces": [ "vlan1011/2a07:9c0:1:1:216:3eff:fe23:b111" ]
},
"option-data": [ {
"name": "dns-servers",
"data": "2001:db8::1, 2001:db8::2"
} ],
"mac-sources": ["duid"],
"subnet6": [
{
"subnet": "2001:db8::/64",
"id": 1024,
"interface" : "vlan1011",
"pools": [
{ "pool": "2001:db8::100-2001:db8::ffff" }
],
"pd-pools": [
{
"prefix": "2a07:9c0:6701::",
"prefix-len": 48,
"delegated-len": 56
}
],
"reservations": [
{
"hw-address": "00:0C:42:A1:AB:79",
"prefixes": [ "2a07:9c0:6701:0800::/56" ]
},
{
"hw-address": "00:0C:42:96:C5:87",
"prefixes": [ "2a07:9c0:6701::/56" ]
},
{
"hw-address": "18:D6:C7:51:ED:3B",
"prefixes": [ "2a07:9c0:6701:200::/56" ]
}
]
}
]
},
"Logging": {
"loggers": [
{
"name": "kea-dhcp6.packets",
"output_options": [
{
"output": "/var/log/kea-debug.log",
"maxver": 8,
"maxsize": 204800,
"flush": true
}
],
"severity": "DEBUG",
"debuglevel": 99
},
{
"name": "kea-dhcp6.leases",
"output_options": [
{
"output": "stdout"
}
],
"severity": "INFO",
"debuglevel": 99
}
]
}
}
now im test in debian jessie,compile in local kea v 1.3.0 test default config /kea-hook-runscript-master/examples/slash32_leases/kea-dhcp4.conf
root@ipv6-dhcp-server:~/kea-config# /usr/local/sbin/kea-dhcp4 -c /root/kea-config/kea-dhcp4.conf
2017-11-02 11:51:25.597 INFO [kea-dhcp4.dhcp4/12049] DHCP4_STARTING Kea DHCPv4 server version 1.3.0 starting
2017-11-02 11:51:25.598 ERROR [kea-dhcp4.hooks/12049] HOOKS_OPEN_ERROR failed to open hook library /usr/local/lib/hooks/kea-hook-runscript.so: /usr/local/lib/hooks/kea-hook-runscript.so: undefined symbol: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev
2017-11-02 11:51:25.598 ERROR [kea-dhcp4.dhcp4/12049] DHCP4_PARSER_FAIL failed to create or run parser for configuration element hooks-libraries: hooks libraries failed to validate - library or libraries in error are: /usr/local/lib/hooks/kea-hook-runscript.so(/root/kea-config/kea-dhcp4.conf:8:3)
2017-11-02 11:51:25.599 ERROR [kea-dhcp4.dhcp4/12049] DHCP4_CONFIG_LOAD_FAIL configuration error using file: /root/kea-config/kea-dhcp4.conf, reason: hooks libraries failed to validate - library or libraries in error are: /usr/local/lib/hooks/kea-hook-runscript.so(/root/kea-config/kea-dhcp4.conf:8:3)
2017-11-02 11:51:25.599 ERROR [kea-dhcp4.dhcp4/12049] DHCP4_INIT_FAIL failed to initialize Kea server: configuration error using file '/root/kea-config/kea-dhcp4.conf': hooks libraries failed to validate - library or libraries in error are: /usr/local/lib/hooks/kea-hook-runscript.so(/root/kea-config/kea-dhcp4.conf:8:3)
Closing because it's been 3 years, and stretch is now oldstable.
hello I tried to assemble according to the instructions. The build will be fine, but when I run a kea server it reports an error.
root@ipv6-dhcp-test:~/kea-hook-runscript-master# make g++ -o kea-hook-runscript.so -I ~/kea/src/lib -fPIC -Wno-deprecated -L /usr/local/lib -shared -lkea-dhcpsrv -lkea-dhcp++ -lkea-hooks -lkea-log -lkea-util -lkea-exceptions src/messages.o src/logger.o src/load.o src/runscript.o src/callouts.o src/version.o