Bug 237909 - net/kea: new rc script
Summary: net/kea: new rc script
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Hiroki Sato
Depends on:
Reported: 2019-05-15 10:40 UTC by Martin Pietsch
Modified: 2019-05-15 11:01 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (hrs)

compressed archive of the modified net/kea port (6.16 KB, application/x-xz)
2019-05-15 10:40 UTC, Martin Pietsch
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Pietsch 2019-05-15 10:40:01 UTC
Created attachment 204390 [details]
compressed archive of the modified net/kea port

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.
A compressed archive of the modified net/kea port can be found in the attachment.

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?

I thank you in advance for your answer.

Best regards