Package: anope
Version: 2.0.6-1
Severity: normal

Dear Maintainer,

Please consider adding a native systemd service masking the
init script (fixes the lintian tag in subject[1]).

I had a quick look at the current init script and it looked
quite straight forward to convert to a service description.
My completely untested attempt is attached. Hopefully it
can serve as a starting point for working on this.
Please ask if you have any questions about this, I'm happy to help out
if you provide the testing and review (as I don't actually use
anope myself).

It would also be a good idea to apply some security hardening on
the service. This requires intimate knowledge about the service
so I did not attempt this, hopefully you can add it.
For advice see:
https://lintian.debian.org/tags/systemd-service-file-missing-hardening-features.html

Finally, please also get rid of the START=no anti-pattern[2] used in
/etc/default/anope and the init script. If you want the user to
review the configuration before it's safe to start the service,
then don't enable the service! Let the user enable it once
they've done the necessary precautionary steps via standardized
system-wide commands, eg. `systemctl enable --now anope`
(rather than knowing about modifying distro and application specific
configuration files).

Regards,
Andreas Henriksson

[1]: 
https://lintian.debian.org/tags/missing-systemd-service-for-init.d-script.html
[2]: 
https://lintian.debian.org/tags/init.d-script-should-always-start-service.html
[Unit]
Description=anope IRC services
After=network.target

[Service]
Type=forking
PIDFile=/run/anope/anope.pid
RuntimeDirectory=anope
# Service supports reloading via SIGHUP, but ExecReload= not set to kill
# because signals are asynchronous and reload command should block until
# reload actually finishes which we have no idea about.
Environment="DAEMON_ARGS=--confdir=/etc/anope --dbdir=/var/lib/anope/db 
--logdir=/var/log/anope --modulesdir=/usr/lib/anope 
--localedir=/usr/share/anope/locale"
EnvironmentFile=-/etc/default/anope
ExecStart=/usr/sbin/anope $DAEMON_ARGS
User=irc
Group=irc
# TODO: security hardening

Reply via email to