Makefile: no, it’s not for such purposes. Doesn’t work (or super hacky).
Debian maintainer scripts: yes.
For standard cases,
debhelper does this (among a lot other repetitive magic) for us. (Grep Whonix source code for (
The debhelper token
#DEBHELPER#in maintainer scripts such as
postinst gets replaced with actual debhelper code. Example:
/var/lib/dpkg/info/*.* files more generally.)
This is sufficient for common use cases for systemd.
Adding a drop-in for a third party package (in our example:
tor) is not a that common case.
So in this case we should add indeed to (already existing) postinst:
Could you add this please?
Not having this is a minor bug. We didn’t spot it yet since after reboot
systemctl daemon-reload is no longer required.
But it’s not a clean solution. The upstream bug against the debian
systemd pacakge should be:
debhelper should run systemctl --system daemon-reload when a package is shipping a systemd drop-in file in /lib/systemd/system/service.service.d/
Could you report that bug please?