Bugzilla – Bug 1074096
brltty %post failure for brltty.service
Last modified: 2018-05-15 10:54:10 UTC
Noticed during zypper dup to the latest tumbleweed: (105/220) Installing: brltty-5.5-2.2.x86_64..............................[done] Additional rpm output: Failed to preset unit: Unit file brltty.service does not exist. Failed to try-restart brltty.service: Unit brltty.service not found. rpm -ql brltty | grep systemd explains it - the package includes /usr/lib/systemd/system/brltty.target /usr/lib/systemd/system/brltty@.service /usr/lib/systemd/system/brltty@.target so there really is no brltty.service.
but then using brltty@.service in %pre/%post/%preun/%postun is just as wrong. foo@.service is the parametrized version of the unit file, you can never restart that one directly as this would always require a parameter. see also https://discourse.nordisch.org/t/hooking-up-instantiated-services-with-rpm/476
actually it should be brltty.target for the %service_add/del macros: from Documents/Changelog: Systemd changes: The default instance is now brltty.target (not brltty.service). Multiple instances can be managed (via brltty@.target instances). so it should be %service_add_pre %{name}.target and so on.
not sure this works correctly, will have to look again...
argh .. okay: brltty.target for brltty-5.5 brltty.path for brltty-5.6 they have changed the pattern again.