[Pkg-systemd-maintainers] How to add systemd unit files for inetd-like services?
Moritz Mühlenhoff
jmm at inutil.org
Fri Aug 2 20:40:26 BST 2013
On Fri, Aug 02, 2013 at 07:10:12PM +0200, Michael Stapelberg wrote:
> Hi Moritz,
>
> many thanks for your interest in systemd and for contacting us!
You're welcome. I'll run a few more complicated unit files for review
by this list in the next weeks.
> Moritz Mühlenhoff <jmm at inutil.org> writes:
> > I researched/wrote up two service files and put them into
> > /etc/systemd/system:
> I assume you know this already, but let’s just state it again: when you
> actually want to ship the files in a Debian package, /etc/systemd/system
> is _not_ the path they should go into :). /lib/systemd/system is the
> only path that packages should touch.
Yep, I know. I first wanted to experiment with the correctness of the
unit files before I integrated them in the packaging system.
> > leafnode.socket:
> > [Unit]
> > Description=NNTP server for small sites (socket)
> Consider adding Documentation=man:leafnode(1) so that the manpage is
> referenced in e.g. systemctl status :).
Good hint, thanks.
> > These two work very well in my tests. Can you advise on the correct way to hook
> > these into a package using dh-systemd ?
> Yep, the unit files look fine. Given that we currently don’t support
> shipping a .socket file by just putting it into debian/$package.socket,
> you will need to manually put these files in place before calling
> dh_systemd_enable in debian/rules:
>
> dh_installcron
> mkdir -p debian/leafnode/lib/systemd/system
> cp debian/leafnode.socket
> debian/leafnode/lib/systemd/system/leafnode.socket
> cp debian/leafnode at .service
> debian/leafnode/lib/systemd/system/leafnode at .service
> dh_systemd_enable
> dh_systemd_start
> dh_installchangelogs
>
> That generates maintscripts which look correct on first glance, but I
> have not actually tested whether it works properly. Feedback welcome!
Thanks, I'll wrap this up in a test package and report on the result
here and in #718592.
Cheers,
Moritz
More information about the Pkg-systemd-maintainers
mailing list