- Package:
- init-system-helpers
- Source:
- init-system-helpers
- Submitter:
- Antonio Terceiro
- Date:
- 2023-07-11 14:57:02 UTC
- Severity:
- normal
- Tags:
`deb-systemd-helper enable foo@1.service` will not work even if the corresponding foo@.service is correctly in place. Use case: in the new version of debci, you will be able to run multiple worker instances on each system, but by default I want to enable and start the first one in postinst. I hope I understand how all of this is supposed to work, so I am currently doing it like this: http://anonscm.debian.org/cgit/collab-maint/debci.git/commit/?id=cef32ff04680607a4e41a9673649e8320f649c95 Are we supposed to have packages managing instanciated template units like this?
Control: tags -1 confirmed I can confirm deb-systemd-* do not support instanced templated units, and this is a pretty big hole. Patches to make it work welcome. Saludos
Hi there! I wrote a backupscript for btrfs-filesystem and need to activate on instantiated unit on several timer-units. Manually systemctl enable mkbackup@weekly.service mkbackup@daily.service works. But deb-systemd-helper enable $SERVICE >/dev/null || true But deb-systemd-helper gives me /usr/bin/deb-systemd-helper: error: unable to read kbackup@daily.service /usr/bin/deb-systemd-helper: error: unable to read kbackup@weekly.service for this services. regards jakob
Hi there! I tried this--- /usr/bin/deb-systemd-helper 2017-02-25 03:56:20.844471315 +0100 +++ /usr/bin/deb-systemd-helper-instantunits 2017-02-25 04:27:56.794876790 +0100 @@ -118,6 +118,7 @@ my ($scriptname) = @_; my $service_path = $scriptname; + $scriptname =~ s/\@.*\.([a-z]*)$/@.\1/; if (-f "/etc/systemd/system/$scriptname") { $service_path = "/etc/systemd/system/$scriptname"; } elsif (-f "/lib/systemd/system/$scriptname") { and now i can work with instantiated unit-files. Regards! Jakob
Hi there! I tried this--- /usr/bin/deb-systemd-helper 2017-02-25 03:56:20.844471315 +0100 +++ /usr/bin/deb-systemd-helper-instantunits 2017-02-25 04:27:56.794876790 +0100 @@ -118,6 +118,7 @@ my ($scriptname) = @_; my $service_path = $scriptname; + $scriptname =~ s/\@.*\.([a-z]*)$/@.\1/; if (-f "/etc/systemd/system/$scriptname") { $service_path = "/etc/systemd/system/$scriptname"; } elsif (-f "/lib/systemd/system/$scriptname") { and now i can work with instantiated unit-files. Regards! Jakob
I changed my Patch... Now it seems to work correct.
I've opened a merge request on Salsa with another possible fix. It works for me locally, but I would like any feedback if I made a mistake somewhere. I've attached the patch as an attachment and the MR is at https://salsa.debian.org/debian/init-system-helpers/-/merge_requests/20.
Control: tags -1 - patch The MR was merged, but I realise now that the original bug is about manipulating instances of template units, which is not what my patch addressed. I've removed the patch tag from this bug report.
Hi, I am not sure if I understood everything properly. I tried to fix this bug with this MR: Support template units (!23) * Merge requests * Debian / init-system-helpers * GitLab<https://salsa.debian.org/debian/init-system-helpers/-/merge_requests/23> Would be nice if someone with a better understanding of deb-systemd-helper could have a look. Thanks Manuel