Hi Andrea, On Mon, Oct 09, 2023 at 02:10:27PM +0200, Andrea Bolognani wrote: > For libvirt, the upstream build system actually installs systemd > units under /usr/lib, and we move things around in debian/rules so > that they end up under /lib in the Debian package: > > SRV_MONOLITHIC = libvirt-guests virtlogd virtlockd \ > libvirtd libvirtd-tcp libvirtd-tls virt-guest-shutdown > > set -e; for f in $(SRV_MONOLITHIC); do \ > dh_install -p libvirt-daemon-system \ > usr/lib/systemd/system/$${f}* \ > lib/systemd/system/; \ > done > > I wouldn't be surprised if other packages did something similar.
This definitely is more common, yes. > In this case, instead of throwing dh_movetousr into the mix, wouldn't > it be more sensible to drop the rename part and just follow the > upstream build system? In the long run, I definitely agree. In the short term, there are downsides. > I guess this could theoretically be problematic for backports, as the > dh_movetousr approach would guarantee that units still end up in /lib > on bookworm and older but this wouldn't. On the other hand, hasn't > systemd been able to load units both from /lib and /usr/lib for > several releases now? So I would expect that to work somewhat > transparently. This is correct. systemd handles both locations since very long. > Am I missing something? I have to admit that, while I've tried to > keep tabs on the discussion and all the great work you and other have > been doing to push things forward, I never quite managed to fully > absorb the problem space. Yes, you are and what you are missing really is not obvious, so thanks for asking! For one thing, dh_installsystemd generates maintainer scripts for restarting services. Before version 13.11.6, it did not recognize the /usr location. If you were to backport such a package, bookworm's debhelper would not generate the relevant maintainer scripts. You can mitigate this by issuing "Build-Depends: debhelper (>= 13.11.6~)". Thus, you'll be using a backported debhelper (unless the backporter carelessly deletes this dependency). For another, we have this generic file loss problem (DEP17 P1). If - in addition to moving units to /usr - you also restructure your package between bookworm and trixie (move units between binary packages), then an upgrade scenario may delete those files even in the presence of correct Breaks+Replaces. As long as you are sure that you do not rename any binary packages nor move any units between packages from bookworm to trixie, this won't apply. Such renames or moves are hard to predict though. So if you understand these limitations and are prepared to handle them for backports, cleaning things up now is fine. If you are not, deferring that cleanup until after trixie and using dh_movetousr in the interim, may be the simpler option. Helmut