Bug#886812: service: start/stop tries to use invalid systemd units when using socket templates
Michael Biebl
biebl at debian.org
Wed Jan 10 11:23:28 GMT 2018
Am 10.01.2018 um 09:57 schrieb Cyrill Troxler:
> Package: init-system-helpers
> Version: 1.48
>
> I stumbled upon a issue with the start/stop triggers when using systemd
> socket templates on Debian stretch. I started getting unrelated error
> messages when entering `service some_service start` on a system which
> has a systemd socket template defined. The issue is quite easy to
> replicate:
>
> ```
> # touch /etc/systemd/system/test at .socket
> # service cron start
> Failed to get properties: Unit name test at .socket is not valid.
> ```
>
> I have tracked down the issue to line 205 in /usr/sbin/service. (line
> 182 in 1.51)
> ```
> for unit in $(systemctl list-unit-files --full --type=socket
> 2>/dev/null | sed -ne 's/\.socket\s*[a-z]*\s*$/.socket/p'); do
> if [ "$(systemctl -p Triggers show $unit)"
>
> ```
> Here it gets all unit files and then tries to show get the Triggers of
> that unit. This not only causes the error message shown above, it also
> causes not stopping the actual socket units like it is described in the
> comment above line 205. The issue could be solved by using `list-units`
> instead of `list-unit-files` because `list-units` will only list actual
> socket units and not their templates.
Afaics the problem is that you created an invalid (empty) .socket
template file.
The problem with list-units afair was, that it only shows units which
are currently in memory.
--
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20180110/9f3fb1f6/attachment-0002.sig>
More information about the Pkg-systemd-maintainers
mailing list