Hello Anand,
I'm building Knot RPM packages for use on CentOS
7, and I have to write
systemd unit files. Before I write anything, I'd love to hear from
others who may already have done such work, to learn from it. Let me
describe my ideas.
I build up-to-date Knot DNS packages for EPEL 7. The sources are in Fedora
git, so you can use them as a starting point if you want:
http://pkgs.fedoraproject.org/cgit/knot.git/tree/?h=epel7
If you don't require any special patches, you can also send me your changes or
requirements and I can incorporate them into these "official" builds.
EPEL 7 is still beta (I think), so there is not update process at the moment
and Knot DNS 1.5.1 should be already in the repositories. Alternatively, you
can download the package from the build system:
http://koji.fedoraproject.org/koji/buildinfo?buildID=569206
In systemd, there is better support for instances, so
I want to create a
knot@.service template unit, and a knot.target target unit. Then, I can
create new instances with "systemctl enable knot(a)conf1.conf" and
"systemctl enable knot(a)conf2.conf"quot;. Finally, running "systemctl start
knot.target" should start all configured instances. Does this sound
reasonable?
Yes, the usage of templates is completely reasonable. But I'm not sure about
the .target unit. The targets are designed for services starting - I think
that it won't work for other operations (e.g., service restart). Maybe someone
can clarify it, I do not have experience with this systemd feature.
I would also like to know about Knot's built-in
support for systemd. I
can't find any documentation about it. Could one of the devs please
describe what Knot actually does if it's compiled with systemd support?
Would you mind adding this information to the online documentation?
Knot DNS supports startup notifications (sd_notify), however we do not have
any feedback on this feature from our users. And there might be some space for
improvements.
We also support structured logging into journal, which is also a feature we
intend to improve - thoughts are welcome. At the moment, we just append a
field with zone name to the logged messages. Therefore, you can query journal
for messages for one zone by running:
# journalctl _SYSTEMD_UNIT=knot.service
ZONE=example.com
We do not support socket activation. We had some request for this feature
recently, however it is somewhere down on our TODO list.
We will definitely update documentation to include information about systemd.
Best regards,
Jan