net/kea: new rc script

Martin Pietsch pietsch_martin at web.de
Wed May 15 08:15:02 UTC 2019


To whom it may concern,

I have a question concerning the Kea DHCP Server package of the FreeBSD repository. But at first I want to describe what I want to do, what problems I have and how I have solved them.

I want to provide the Kea DHCP service within a jail container. Furthermore, I want to manage this service with Ansible. During the installation and configuration of that service, I noticed two problems with the rc script of Kea.

The first problem relates to the use of Kea within a jail container. The usage of Kea within a jail container is easily possible and it is also described in the Kea Documentation since Kea version 1.4 (https://ftp.isc.org/isc/Kea/cur/doc/Kea-guide.pdf, page 39). The problem is now that the keyword "nojail" in Kea's rc script prevents the service from starting automatically when the jail container starts.

The second problem has to do with the invocation of rc script. This current script uses the keactrl tool to start one or more of the services that are provided by the Kea suite and all information on which services have to be started can be found in the keactrl.conf file. The problem is that the returncode of keactrl is usually 0. The same is true if you want to check the state of a single service of this suite. Normally, the service(8) command returns a 0 if a service is running and 1 if the service is not running. In the case of the Kea's rc script the keactrl displays a conclusion of all services states on stdout and returns always 0. Especially configuration management systems, in my case Ansible, and other programs or scripts use the returncode of the service(8) command to determinate the state of a service. For example Ansible checks the state of a service before it starts or stops this. So it is not possible to start a Kea service as usual.

To solve these problems, I developed a new rc script for the Kea suite which can be used within a jail container and controls each service separately. The control is done by using the name of the invoked rc script, so that all Kea services only have to be a soft link to this new rc script.
You find the modified Makefile and pkg-plist from the net/kea port and the rc script, which I have created, in the appendix of this mail.

And now back to my question. Is it possible to replace the current Kea rc script in the port source with the rc script I developed or add it to the port source? If it is, what do I have to do for this? What do you think about it? Please can you help me answer this question?


I thank you in advance for your answer.

Best regards
Martin
-------------- next part --------------
# $FreeBSD: head/net/kea/Makefile 498698 2019-04-12 06:36:31Z jbeich $

PORTNAME=	kea
PORTVERSION=	${ISCVERSION:S/-P/P/:S/-beta/b/:S/a/.a/:S/rc/.rc/}
PORTREVISION=	2
CATEGORIES=	net ipv6
MASTER_SITES=	ISC/kea/${ISCVERSION}
DISTNAME=	${PORTNAME}-${ISCVERSION}

MAINTAINER=	hrs at FreeBSD.org
COMMENT=	Alternative DHCP implementation by ISC

LICENSE=	MPL20
LICENSE_FILE=	${WRKSRC}/COPYING

BROKEN_powerpc64=	fails to configure: checking for log4cplus library... no

LIB_DEPENDS=	liblog4cplus.so:devel/log4cplus \
		libboost_system.so:devel/boost-libs

# ISC releases things like 1.4.0-P1, which our versioning doesn't like
ISCVERSION=	1.5.0

CPE_VENDOR=	isc
CPE_VERSION=	${ISCVERSION:C/-.*//}
.if ${ISCVERSION:M*-*}
CPE_UPDATE=	${ISCVERSION:C/.*-//:tl}
.endif

USES=		autoreconf compiler:c++11-lang iconv libtool pathfix ssl cpe
USE_LDCONFIG=	yes
USE_RC_SUBR=	kea_dhcp4
GNU_CONFIGURE=	yes
CONFIGURE_ARGS=	--with-openssl=${OPENSSLBASE} \
		--with-log4cplus=${LOCALBASE} \
		--with-boost-include=${LOCALBASE}/include \
		--with-boost-lib-dir=${LOCALBASE}/lib \
		--without-werror
INSTALL_TARGET=	install-strip
TEST_TARGET=	check

PORTDOCS=	AUTHORS COPYING ChangeLog README \
		kea-guide.css kea-guide.html kea-guide.txt \
		kea-messages.html kea-logo-100x70.png \
		examples

OPTIONS_DEFINE=	DOCS MYSQL PGSQL
OPTIONS_SUB=	yes
DOCS_MAKE_ARGS_OFF=	\
		INSTALL_STRIP_PROGRAM="${WRKSRC}/install-sh -c -s" \
		INSTALL_STRIP_FLAG="-s" \
		INSTALL_PROGRAM_ENV="STRIPPROG=${STRIP}"
DOCS_INSTALL_TARGET_OFF=	\
		install-exec-am \
		install-pkgconfigDATA \
		install-pkgincludeHEADERS
MYSQL_USE=	MYSQL=client
MYSQL_CONFIGURE_ON=	--with-dhcp-mysql=${LOCALBASE}/bin/mysql_config
MYSQL_CONFIGURE_OFF=	--without-dhcp-mysql
PGSQL_USES=	pgsql
WANT_PGSQL=	client
PGSQL_CONFIGURE_ON=	--with-dhcp-pgsql=${LOCALBASE}/bin/pg_config
PGSQL_CONFIGURE_OFF=	--without-dhcp-pgsql

do-install:
	${SETENV} DESTDIR=${STAGEDIR} ${MAKE} -C ${WRKSRC} install
	@${LN} -sf kea_dhcp4 ${STAGEDIR}${PREFIX}/etc/rc.d/kea_ctrl_agent
	@${LN} -sf kea_dhcp4 ${STAGEDIR}${PREFIX}/etc/rc.d/kea_dhcp6
	@${LN} -sf kea_dhcp4 ${STAGEDIR}${PREFIX}/etc/rc.d/kea_dhcp_ddns

.include <bsd.port.mk>
-------------- next part --------------
bin/kea-msg-compiler
include/kea/asiodns/io_fetch.h
include/kea/asiodns/logger.h
include/kea/asiolink/addr_utilities.h
include/kea/asiolink/asio_wrapper.h
include/kea/asiolink/asiolink.h
include/kea/asiolink/dummy_io_cb.h
include/kea/asiolink/interval_timer.h
include/kea/asiolink/io_acceptor.h
include/kea/asiolink/io_address.h
include/kea/asiolink/io_asio_socket.h
include/kea/asiolink/io_endpoint.h
include/kea/asiolink/io_error.h
include/kea/asiolink/io_service.h
include/kea/asiolink/io_socket.h
include/kea/asiolink/tcp_acceptor.h
include/kea/asiolink/tcp_endpoint.h
include/kea/asiolink/tcp_socket.h
include/kea/asiolink/udp_endpoint.h
include/kea/asiolink/udp_socket.h
include/kea/asiolink/unix_domain_socket.h
include/kea/asiolink/unix_domain_socket_acceptor.h
include/kea/asiolink/unix_domain_socket_endpoint.h
include/kea/cc/cfg_to_element.h
include/kea/cc/command_interpreter.h
include/kea/cc/data.h
include/kea/cc/dhcp_config_error.h
include/kea/cc/json_feed.h
include/kea/cc/simple_parser.h
include/kea/cc/stamped_element.h
include/kea/cc/stamped_value.h
include/kea/cc/user_context.h
include/kea/cfgrpt/config_report.h
include/kea/config.h
include/kea/config/base_command_mgr.h
include/kea/config/client_connection.h
include/kea/config/cmds_impl.h
include/kea/config/command_mgr.h
include/kea/config/config_log.h
include/kea/config/hooked_command_mgr.h
include/kea/config/timeouts.h
include/kea/config_backend/base_config_backend.h
include/kea/config_backend/base_config_backend_mgr.h
include/kea/config_backend/base_config_backend_pool.h
include/kea/config_backend/constants.h
include/kea/cryptolink/crypto_hash.h
include/kea/cryptolink/crypto_hmac.h
include/kea/cryptolink/crypto_rng.h
include/kea/cryptolink/cryptolink.h
include/kea/cryptolink/openssl_common.h
include/kea/cryptolink/openssl_compat.h
include/kea/database/backend_selector.h
include/kea/database/database_connection.h
include/kea/database/db_exceptions.h
include/kea/database/db_log.h
include/kea/database/dbaccess_parser.h
include/kea/database/server_selector.h
include/kea/dhcp/classify.h
include/kea/dhcp/dhcp4.h
include/kea/dhcp/dhcp6.h
include/kea/dhcp/docsis3_option_defs.h
include/kea/dhcp/duid.h
include/kea/dhcp/duid_factory.h
include/kea/dhcp/hwaddr.h
include/kea/dhcp/iface_mgr.h
include/kea/dhcp/iface_mgr_error_handler.h
include/kea/dhcp/libdhcp++.h
include/kea/dhcp/opaque_data_tuple.h
include/kea/dhcp/option.h
include/kea/dhcp/option4_addrlst.h
include/kea/dhcp/option4_client_fqdn.h
include/kea/dhcp/option6_addrlst.h
include/kea/dhcp/option6_auth.h
include/kea/dhcp/option6_client_fqdn.h
include/kea/dhcp/option6_ia.h
include/kea/dhcp/option6_iaaddr.h
include/kea/dhcp/option6_iaprefix.h
include/kea/dhcp/option6_pdexclude.h
include/kea/dhcp/option6_status_code.h
include/kea/dhcp/option_custom.h
include/kea/dhcp/option_data_types.h
include/kea/dhcp/option_definition.h
include/kea/dhcp/option_int.h
include/kea/dhcp/option_int_array.h
include/kea/dhcp/option_opaque_data_tuples.h
include/kea/dhcp/option_space.h
include/kea/dhcp/option_space_container.h
include/kea/dhcp/option_string.h
include/kea/dhcp/option_vendor.h
include/kea/dhcp/option_vendor_class.h
include/kea/dhcp/packet_queue.h
include/kea/dhcp/packet_queue_mgr.h
include/kea/dhcp/packet_queue_mgr4.h
include/kea/dhcp/packet_queue_mgr6.h
include/kea/dhcp/packet_queue_ring.h
include/kea/dhcp/pkt.h
include/kea/dhcp/pkt4.h
include/kea/dhcp/pkt4o6.h
include/kea/dhcp/pkt6.h
include/kea/dhcp/pkt_filter.h
include/kea/dhcp/pkt_filter6.h
include/kea/dhcp/pkt_filter_bpf.h
include/kea/dhcp/pkt_filter_inet.h
include/kea/dhcp/pkt_filter_inet6.h
include/kea/dhcp/protocol_util.h
include/kea/dhcp/socket_info.h
include/kea/dhcp/std_option_defs.h
include/kea/dhcp_ddns/dhcp_ddns_log.h
include/kea/dhcp_ddns/ncr_io.h
include/kea/dhcp_ddns/ncr_msg.h
include/kea/dhcp_ddns/ncr_udp.h
include/kea/dhcpsrv/alloc_engine.h
include/kea/dhcpsrv/alloc_engine_log.h
include/kea/dhcpsrv/assignable_network.h
include/kea/dhcpsrv/base_host_data_source.h
include/kea/dhcpsrv/cache_host_data_source.h
include/kea/dhcpsrv/callout_handle_store.h
include/kea/dhcpsrv/cfg_4o6.h
include/kea/dhcpsrv/cfg_consistency.h
include/kea/dhcpsrv/cfg_db_access.h
include/kea/dhcpsrv/cfg_duid.h
include/kea/dhcpsrv/cfg_expiration.h
include/kea/dhcpsrv/cfg_host_operations.h
include/kea/dhcpsrv/cfg_hosts.h
include/kea/dhcpsrv/cfg_hosts_util.h
include/kea/dhcpsrv/cfg_iface.h
include/kea/dhcpsrv/cfg_mac_source.h
include/kea/dhcpsrv/cfg_option.h
include/kea/dhcpsrv/cfg_option_def.h
include/kea/dhcpsrv/cfg_rsoo.h
include/kea/dhcpsrv/cfg_shared_networks.h
include/kea/dhcpsrv/cfg_subnets4.h
include/kea/dhcpsrv/cfg_subnets6.h
include/kea/dhcpsrv/cfgmgr.h
include/kea/dhcpsrv/client_class_def.h
include/kea/dhcpsrv/config_backend_dhcp4.h
include/kea/dhcpsrv/config_backend_dhcp4_mgr.h
include/kea/dhcpsrv/config_backend_pool_dhcp4.h
include/kea/dhcpsrv/csv_lease_file4.h
include/kea/dhcpsrv/csv_lease_file6.h
include/kea/dhcpsrv/d2_client_cfg.h
include/kea/dhcpsrv/d2_client_mgr.h
include/kea/dhcpsrv/db_type.h
include/kea/dhcpsrv/dhcp4o6_ipc.h
include/kea/dhcpsrv/dhcpsrv_exceptions.h
include/kea/dhcpsrv/dhcpsrv_log.h
include/kea/dhcpsrv/host.h
include/kea/dhcpsrv/host_container.h
include/kea/dhcpsrv/host_data_source_factory.h
include/kea/dhcpsrv/host_mgr.h
include/kea/dhcpsrv/hosts_log.h
include/kea/dhcpsrv/key_from_key.h
include/kea/dhcpsrv/lease.h
include/kea/dhcpsrv/lease_file_loader.h
include/kea/dhcpsrv/lease_file_stats.h
include/kea/dhcpsrv/lease_mgr.h
include/kea/dhcpsrv/lease_mgr_factory.h
include/kea/dhcpsrv/memfile_lease_mgr.h
include/kea/dhcpsrv/memfile_lease_storage.h
%%MYSQL%%include/kea/dhcpsrv/mysql_host_data_source.h
%%MYSQL%%include/kea/dhcpsrv/mysql_lease_mgr.h
include/kea/dhcpsrv/ncr_generator.h
include/kea/dhcpsrv/network.h
include/kea/dhcpsrv/network_state.h
include/kea/dhcpsrv/parsers/client_class_def_parser.h
include/kea/dhcpsrv/parsers/dhcp_parsers.h
include/kea/dhcpsrv/parsers/dhcp_queue_control_parser.h
include/kea/dhcpsrv/parsers/duid_config_parser.h
include/kea/dhcpsrv/parsers/expiration_config_parser.h
include/kea/dhcpsrv/parsers/host_reservation_parser.h
include/kea/dhcpsrv/parsers/host_reservations_list_parser.h
include/kea/dhcpsrv/parsers/ifaces_config_parser.h
include/kea/dhcpsrv/parsers/option_data_parser.h
include/kea/dhcpsrv/parsers/sanity_checks_parser.h
include/kea/dhcpsrv/parsers/shared_network_parser.h
include/kea/dhcpsrv/parsers/shared_networks_list_parser.h
include/kea/dhcpsrv/parsers/simple_parser4.h
include/kea/dhcpsrv/parsers/simple_parser6.h
include/kea/dhcpsrv/pool.h
%%PGSQL%%include/kea/dhcpsrv/pgsql_host_data_source.h
%%PGSQL%%include/kea/dhcpsrv/pgsql_lease_mgr.h
include/kea/dhcpsrv/sanity_checker.h
include/kea/dhcpsrv/shared_network.h
include/kea/dhcpsrv/srv_config.h
include/kea/dhcpsrv/subnet.h
include/kea/dhcpsrv/subnet_id.h
include/kea/dhcpsrv/subnet_selector.h
include/kea/dhcpsrv/timer_mgr.h
include/kea/dhcpsrv/triplet.h
include/kea/dhcpsrv/utils.h
include/kea/dhcpsrv/writable_host_data_source.h
include/kea/dns/dns_fwd.h
include/kea/dns/edns.h
include/kea/dns/exceptions.h
include/kea/dns/labelsequence.h
include/kea/dns/master_lexer.h
include/kea/dns/master_lexer_inputsource.h
include/kea/dns/master_lexer_state.h
include/kea/dns/master_loader.h
include/kea/dns/master_loader_callbacks.h
include/kea/dns/masterload.h
include/kea/dns/message.h
include/kea/dns/messagerenderer.h
include/kea/dns/name.h
include/kea/dns/nsec3hash.h
include/kea/dns/opcode.h
include/kea/dns/question.h
include/kea/dns/rcode.h
include/kea/dns/rdata.h
include/kea/dns/rdata_pimpl_holder.h
include/kea/dns/rdataclass.h
include/kea/dns/rdatafields.h
include/kea/dns/rrclass.h
include/kea/dns/rrcollator.h
include/kea/dns/rrparamregistry.h
include/kea/dns/rrset.h
include/kea/dns/rrset_collection.h
include/kea/dns/rrset_collection_base.h
include/kea/dns/rrttl.h
include/kea/dns/rrtype.h
include/kea/dns/serial.h
include/kea/dns/tsig.h
include/kea/dns/tsigerror.h
include/kea/dns/tsigkey.h
include/kea/dns/tsigrecord.h
include/kea/dns/zone_checker.h
include/kea/eval/dependency.h
include/kea/eval/eval_context.h
include/kea/eval/eval_context_decl.h
include/kea/eval/eval_log.h
include/kea/eval/evaluate.h
include/kea/eval/parser.h
include/kea/eval/token.h
include/kea/exceptions/exceptions.h
include/kea/hooks/callout_handle.h
include/kea/hooks/callout_handle_associate.h
include/kea/hooks/callout_manager.h
include/kea/hooks/hooks.h
include/kea/hooks/hooks_config.h
include/kea/hooks/hooks_log.h
include/kea/hooks/hooks_manager.h
include/kea/hooks/hooks_parser.h
include/kea/hooks/libinfo.h
include/kea/hooks/library_handle.h
include/kea/hooks/library_manager.h
include/kea/hooks/library_manager_collection.h
include/kea/hooks/parking_lots.h
include/kea/hooks/pointer_converter.h
include/kea/hooks/server_hooks.h
include/kea/http/client.h
include/kea/http/connection.h
include/kea/http/connection_pool.h
include/kea/http/date_time.h
include/kea/http/header_context.h
include/kea/http/http_acceptor.h
include/kea/http/http_header.h
include/kea/http/http_log.h
include/kea/http/http_message.h
include/kea/http/http_message_parser_base.h
include/kea/http/http_types.h
include/kea/http/listener.h
include/kea/http/post_request.h
include/kea/http/post_request_json.h
include/kea/http/request.h
include/kea/http/request_context.h
include/kea/http/request_parser.h
include/kea/http/response.h
include/kea/http/response_context.h
include/kea/http/response_creator.h
include/kea/http/response_creator_factory.h
include/kea/http/response_json.h
include/kea/http/response_parser.h
include/kea/http/url.h
include/kea/kea_version.h
include/kea/log/buffer_appender_impl.h
include/kea/log/interprocess/interprocess_sync.h
include/kea/log/interprocess/interprocess_sync_file.h
include/kea/log/interprocess/interprocess_sync_null.h
include/kea/log/log_dbglevels.h
include/kea/log/log_formatter.h
include/kea/log/log_messages.h
include/kea/log/logger.h
include/kea/log/logger_impl.h
include/kea/log/logger_level.h
include/kea/log/logger_level_impl.h
include/kea/log/logger_manager.h
include/kea/log/logger_manager_impl.h
include/kea/log/logger_name.h
include/kea/log/logger_specification.h
include/kea/log/logger_support.h
include/kea/log/logger_unittest_support.h
include/kea/log/logimpl_messages.h
include/kea/log/macros.h
include/kea/log/message_dictionary.h
include/kea/log/message_exception.h
include/kea/log/message_initializer.h
include/kea/log/message_reader.h
include/kea/log/message_types.h
include/kea/log/output_option.h
%%MYSQL%%include/kea/mysql/mysql_binding.h
%%MYSQL%%include/kea/mysql/mysql_connection.h
%%MYSQL%%include/kea/mysql/mysql_constants.h
%%PGSQL%%include/kea/pgsql/pgsql_connection.h
%%PGSQL%%include/kea/pgsql/pgsql_exchange.h
include/kea/process/config_base.h
include/kea/process/config_ctl_info.h
include/kea/process/config_ctl_parser.h
include/kea/process/d_cfg_mgr.h
include/kea/process/d_controller.h
include/kea/process/d_log.h
include/kea/process/d_process.h
include/kea/process/daemon.h
include/kea/process/io_service_signal.h
include/kea/process/log_parser.h
include/kea/process/logging_info.h
include/kea/stats/context.h
include/kea/stats/observation.h
include/kea/stats/stats_mgr.h
include/kea/util/boost_time_utils.h
include/kea/util/buffer.h
include/kea/util/csv_file.h
include/kea/util/encode/base16_from_binary.h
include/kea/util/encode/base32hex.h
include/kea/util/encode/base32hex_from_binary.h
include/kea/util/encode/base64.h
include/kea/util/encode/binary_from_base16.h
include/kea/util/encode/binary_from_base32hex.h
include/kea/util/encode/hex.h
include/kea/util/filename.h
include/kea/util/hash.h
include/kea/util/io/fd.h
include/kea/util/io/fd_share.h
include/kea/util/io/pktinfo_utilities.h
include/kea/util/io/sockaddr_util.h
include/kea/util/io/socketsession.h
include/kea/util/io_utilities.h
include/kea/util/labeled_value.h
include/kea/util/memory_segment.h
include/kea/util/memory_segment_local.h
include/kea/util/optional_value.h
include/kea/util/pid_file.h
include/kea/util/pointer_util.h
include/kea/util/process_spawn.h
include/kea/util/random/qid_gen.h
include/kea/util/random/random_number_generator.h
include/kea/util/range_utilities.h
include/kea/util/signal_set.h
include/kea/util/staged_value.h
include/kea/util/state_model.h
include/kea/util/stopwatch.h
include/kea/util/stopwatch_impl.h
include/kea/util/strutil.h
include/kea/util/threads/sync.h
include/kea/util/threads/thread.h
include/kea/util/threads/watched_thread.h
include/kea/util/time_utilities.h
include/kea/util/versioned_csv_file.h
include/kea/util/watch_socket.h
lib/hooks/libdhcp_ha.a
lib/hooks/libdhcp_ha.so
lib/hooks/libdhcp_lease_cmds.a
lib/hooks/libdhcp_lease_cmds.so
lib/hooks/libdhcp_stat_cmds.a
lib/hooks/libdhcp_stat_cmds.so
lib/libkea-asiodns.a
lib/libkea-asiodns.so
lib/libkea-asiodns.so.0
lib/libkea-asiodns.so.0.0.2
lib/libkea-asiolink.a
lib/libkea-asiolink.so
lib/libkea-asiolink.so.7
lib/libkea-asiolink.so.7.0.0
lib/libkea-cc.a
lib/libkea-cc.so
lib/libkea-cc.so.7
lib/libkea-cc.so.7.0.0
lib/libkea-cfgclient.a
lib/libkea-cfgclient.so
lib/libkea-cfgclient.so.6
lib/libkea-cfgclient.so.6.0.0
lib/libkea-cryptolink.a
lib/libkea-cryptolink.so
lib/libkea-cryptolink.so.4
lib/libkea-cryptolink.so.4.0.0
lib/libkea-database.a
lib/libkea-database.so
lib/libkea-database.so.1
lib/libkea-database.so.1.0.0
lib/libkea-dhcp++.a
lib/libkea-dhcp++.so
lib/libkea-dhcp++.so.11
lib/libkea-dhcp++.so.11.0.0
lib/libkea-dhcp_ddns.a
lib/libkea-dhcp_ddns.so
lib/libkea-dhcp_ddns.so.1
lib/libkea-dhcp_ddns.so.1.0.3
lib/libkea-dhcpsrv.a
lib/libkea-dhcpsrv.so
lib/libkea-dhcpsrv.so.14
lib/libkea-dhcpsrv.so.14.0.0
lib/libkea-dns++.a
lib/libkea-dns++.so
lib/libkea-dns++.so.3
lib/libkea-dns++.so.3.0.0
lib/libkea-eval.a
lib/libkea-eval.so
lib/libkea-eval.so.10
lib/libkea-eval.so.10.0.0
lib/libkea-exceptions.a
lib/libkea-exceptions.so
lib/libkea-exceptions.so.0
lib/libkea-exceptions.so.0.0.1
lib/libkea-hooks.a
lib/libkea-hooks.so
lib/libkea-hooks.so.7
lib/libkea-hooks.so.7.0.2
lib/libkea-http.a
lib/libkea-http.so
lib/libkea-http.so.4
lib/libkea-http.so.4.0.0
lib/libkea-log.a
lib/libkea-log.so
lib/libkea-log.so.3
lib/libkea-log.so.3.0.1
%%MYSQL%%lib/libkea-mysql.a
%%MYSQL%%lib/libkea-mysql.so
%%MYSQL%%lib/libkea-mysql.so.0
%%MYSQL%%lib/libkea-mysql.so.0.0.1
%%PGSQL%%lib/libkea-pgsql.a
%%PGSQL%%lib/libkea-pgsql.so
%%PGSQL%%lib/libkea-pgsql.so.0
%%PGSQL%%lib/libkea-pgsql.so.0.0.0
lib/libkea-process.a
lib/libkea-process.so
lib/libkea-process.so.3
lib/libkea-process.so.3.0.0
lib/libkea-stats.a
lib/libkea-stats.so
lib/libkea-stats.so.2
lib/libkea-stats.so.2.0.2
lib/libkea-threads.a
lib/libkea-threads.so
lib/libkea-threads.so.2
lib/libkea-threads.so.2.0.0
lib/libkea-util-io.a
lib/libkea-util-io.so
lib/libkea-util-io.so.0
lib/libkea-util-io.so.0.0.1
lib/libkea-util.a
lib/libkea-util.so
lib/libkea-util.so.5
lib/libkea-util.so.5.0.0
libdata/pkgconfig/dns++.pc
man/man8/kea-admin.8.gz
man/man8/kea-ctrl-agent.8.gz
man/man8/kea-dhcp-ddns.8.gz
man/man8/kea-dhcp4.8.gz
man/man8/kea-dhcp6.8.gz
man/man8/kea-lfc.8.gz
man/man8/keactrl.8.gz
man/man8/perfdhcp.8.gz
sbin/kea-admin
sbin/kea-ctrl-agent
sbin/kea-dhcp-ddns
sbin/kea-dhcp4
sbin/kea-dhcp6
sbin/kea-lfc
sbin/keactrl
sbin/perfdhcp
%%DATADIR%%/scripts/admin-utils.sh
%%DATADIR%%/scripts/cql/dhcpdb_create.cql
%%DATADIR%%/scripts/cql/dhcpdb_drop.cql
%%DATADIR%%/scripts/cql/soft_wipe.cql
%%DATADIR%%/scripts/cql/upgrade_1.0_to_2.0.sh
%%DATADIR%%/scripts/cql/upgrade_2.0_to_3.0.sh
%%DATADIR%%/scripts/mysql/dhcpdb_create.mysql
%%DATADIR%%/scripts/mysql/dhcpdb_drop.mysql
%%DATADIR%%/scripts/mysql/upgrade_1.0_to_2.0.sh
%%DATADIR%%/scripts/mysql/upgrade_2.0_to_3.0.sh
%%DATADIR%%/scripts/mysql/upgrade_3.0_to_4.0.sh
%%DATADIR%%/scripts/mysql/upgrade_4.0_to_4.1.sh
%%DATADIR%%/scripts/mysql/upgrade_4.1_to_5.0.sh
%%DATADIR%%/scripts/mysql/upgrade_5.0_to_5.1.sh
%%DATADIR%%/scripts/mysql/upgrade_5.1_to_5.2.sh
%%DATADIR%%/scripts/mysql/upgrade_5.2_to_6.0.sh
%%DATADIR%%/scripts/mysql/upgrade_6.0_to_7.0.sh
%%DATADIR%%/scripts/pgsql/dhcpdb_create.pgsql
%%DATADIR%%/scripts/pgsql/dhcpdb_drop.pgsql
%%DATADIR%%/scripts/pgsql/upgrade_1.0_to_2.0.sh
%%DATADIR%%/scripts/pgsql/upgrade_2.0_to_3.0.sh
%%DATADIR%%/scripts/pgsql/upgrade_3.0_to_3.1.sh
%%DATADIR%%/scripts/pgsql/upgrade_3.1_to_3.2.sh
%%DATADIR%%/scripts/pgsql/upgrade_3.2_to_3.3.sh
%%DATADIR%%/scripts/pgsql/upgrade_3.3_to_4.0.sh
%%DATADIR%%/scripts/pgsql/upgrade_4.0_to_5.0.sh
%%DATADIR%%/yang/modules/ietf-dhcpv6-client at 2018-09-04.yang
%%DATADIR%%/yang/modules/ietf-dhcpv6-options at 2018-09-04.yang
%%DATADIR%%/yang/modules/ietf-dhcpv6-relay at 2018-09-04.yang
%%DATADIR%%/yang/modules/ietf-dhcpv6-server at 2018-09-04.yang
%%DATADIR%%/yang/modules/ietf-dhcpv6-types at 2018-09-04.yang
%%DATADIR%%/yang/modules/ietf-inet-types at 2013-07-15.yang
%%DATADIR%%/yang/modules/ietf-interfaces at 2014-05-08.yang
%%DATADIR%%/yang/modules/ietf-yang-types at 2013-07-15.yang
%%DATADIR%%/yang/modules/kea-ctrl-agent at 2018-11-20.yang
%%DATADIR%%/yang/modules/kea-dhcp-ddns at 2018-11-20.yang
%%DATADIR%%/yang/modules/kea-dhcp-types at 2018-11-20.yang
%%DATADIR%%/yang/modules/kea-dhcp4-server at 2018-11-20.yang
%%DATADIR%%/yang/modules/kea-dhcp6-server at 2018-11-20.yang
%%DATADIR%%/yang/modules/kea-logging at 2018-11-20.yang
%%DATADIR%%/yang/modules/kea-types at 2018-11-20.yang
@sample %%ETCDIR%%/kea-ctrl-agent.conf.sample
@sample %%ETCDIR%%/kea-dhcp-ddns.conf.sample
@sample %%ETCDIR%%/kea-dhcp4.conf.sample
@sample %%ETCDIR%%/kea-dhcp6.conf.sample
@sample %%ETCDIR%%/kea-netconf.conf.sample
@sample %%ETCDIR%%/keactrl.conf.sample
etc/rc.d/kea_dhcp6
etc/rc.d/kea_dhcp_ddns
etc/rc.d/kea_ctrl_agent
@dir /var/db/kea
-------------- next part --------------
#!/bin/sh
# $FreeBSD: head/net/kea/files/kea.in 396506 2015-09-09 14:28:47Z hrs $
#
# PROVIDE: kea
# REQUIRE: netif routing
# KEYWORD: shutdown 

#
# Add the following to /etc/rc.conf[.local] to enable one or more ISC Kea services
#
# kea_dhcp4_enable (bool):      Run kea-dhcp4, the DHCPv4 server (or NO)
# kea_dhcp4_conf (str):         Path to the configuration file for kea-dhcp4
# kea_dhcp6_enable (bool):      Run kea-dhcp6, the DHCPv6 server (or NO)
# kea_dhcp6_conf (str):         Path to the configuration file for kea-dhcp6
# kea_dhcp_ddns_enable (bool):  Run kea-dhcp-ddns, the DHCP DDNS server (or NO)
# kea_dhcp_ddns_conf (str):     Path to the configuration file for kea-dhcp-ddns
# kea_ctrl_agent_enable (bool): Run kea-ctrl-agent, the Control Agent (or NO)
# kea_ctrl_agent_conf (str):    Path to the configuration file for kea-ctrl-agent
#

kea_dhcp4_enable=${kea_dhcp4_enable:-"NO"}
kea_dhcp6_enable=${kea_dhcp6_enable:-"NO"}
kea_dhcp_ddns_enable=${kea_dhcp_ddns_enable:-"NO"}
kea_ctrl_agent_enable=${kea_dhcp_ddns_enable:-"NO"}
kea_dhcp4_conf=${kea_dhcp4_conf:-"%%ETCDIR%%/kea-dhcp4.conf"}
kea_dhcp6_conf=${kea_dhcp6_conf:-"%%ETCDIR%%/kea-dhcp6.conf"}
kea_dhcp_ddns_conf=${kea_dhcp_ddns_conf:-"%%ETCDIR%%/kea-dhcp-ddns.conf"}
kea_ctrl_agent_conf=${kea_ctrl_agent_conf:-"%%ETCDIR%%/kea-ctrl-agent.conf"}

. /etc/rc.subr

case $0 in
/etc/rc*)
        # during boot (shutdown) $0 is /etc/rc (/etc/rc.shutdown),
        # so get the name of the script from $_file
        name=$_file
        ;;
*)
        name=$0
        ;;
esac

command="%%PREFIX%%/sbin/kea-${name##*/kea_}"
name="${name##*/}"
kea_config_file=""

case ${name##kea_} in 
  dhcp4)
    kea_config_file=${kea_dhcp4_conf}
    ;;

  dhcp6)
    kea_config_file=${kea_dhcp6_conf}
    ;;

  dhcp_ddns)
    kea_config_file=${kea_dhcp_ddns_conf}
    ;;

  ctrl_agent)
    kea_config_file=${kea_ctrl_agent_conf}
    ;;

  *)
    kea_config_file=""
   ;;

esac

rcvar="${name}_enable"
required_files=${kea_config_file}
extra_commands="reload"
start_precmd="kea_start_precmd"
stop_precmd="kea_cmd_precmd"
reload_precmd="kea_cmd_precmd"
status_precmd="kea_cmd_precmd"

kea_start_precmd()
{
   command_args="-c ${kea_config_file} &"
}

kea_cmd_precmd()
{
   local conf_name=$(basename ${kea_config_file} | cut -f1 -d'.')
   local proc_name=$(basename ${command})

   pidfile="/var/run/${conf_name}.kea-${proc_name}.pid"
}

load_rc_config ${name}
run_rc_command "$1"


More information about the freebsd-ports mailing list