[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#950952: aprx: missing-systemd-service-for-init.d-script



Package: aprx
Version: 2.9.0+dfsg-2
Severity: normal
Tags: bullseye sid

Dear Maintainer,

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

I've attached my own attempt at writing a service file, based off
looking at what the init script does. Note that it is completely
untested (as I don't use aprx myself).
You can install the aprx.service file by simple dropping it into
the debian/ directory and debhelper will handle it for you (however
note that the current compat level 11 is discuraged, so you might want
to move to either 10 or 12).

Please note that the service file could be simplified. By adding
the aprx -i flag the program will run in the foreground and you
could use Type=simple. It is also recommended *not* to use
EnvironmentFile and setting options via /etc/default files, but instead
use 'systemctl edit aprx.service' so that systemd-delta will be able
to show any customizations. I however opted for the attached way
as the user might already have some important settings in DAEMON_OPTS
that I'm not aware of.

Additional improvements eg. using security hardening[2] could also be
added.

Regards,
Andreas Henriksson


[1]: https://lintian.debian.org/tags/missing-systemd-service-for-init.d-script.html
[2]: https://lintian.debian.org/tags/systemd-service-file-missing-hardening-features.html
[Unit]
Description=Monitor and gateway radio amateur APRS radio network datagrams
After=network.target

[Service]
Type=forking
PIDFile=/run/aprx.pid
EnvironmentFile=-/etc/default/aprx
ExecStart=/usr/sbin/aprx $DAEMON_OPTS
#TODO: security hardening

[Install]
WantedBy=multi-user.target

Reply to: