Re: How to correctly handle scriptlets for systemd template unit instances

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 27, 2021 at 05:30:24PM +0200, Fabio Valentini wrote:
> Hi everybody,
> 
> I have a package (syncthing [0]) that provides both system and user
> units, depending on how the user wants the service to start. The user
> units are obviously specific to each user, but the system units are
> templates that are instantiated for the user who wants to have the
> service run at boot.
> 
> Now, this is the problem: I do not know how to adapt the systemd
> scriptlets [1] for this. Wildcards are not supported, and systemd on
> Fedora 34+ now warns when encountering such wildcards, so the way it's
> done in the syncthing package right now is not correct (as reported on
> BugZilla [2]).
> 
>     Glob pattern passed, but globs are not supported for this.
>     Invalid unit name "syncthing@*.service" escaped as "syncthing@\x2a.service".

I'll copy my reply from the bug:

This is an omission from my side. The easiest solution (longer-term)
is to allow such globs in systemd. I filed a simple patch to do this
[1]. When it goes through, I'll push it to F34+ where the new
scriptlet is used

[1] https://github.com/systemd/systemd/pull/20334

> Does anybody know the correct way to handle this? Obviously those
> system units can't (and shouldn't) be enabled for all users on update
> or install, but I still want all service instances to be restarted on
> update. The systemd scriptlet Guidelines do not cover this scenario at
> all.

Short reply: https://fedoraproject.org/wiki/Changes/Restart_User_Service_after_Upgrade

I hope I could convince people to do this for F35…
It sounds like it would be very useful for the syncthing case.

Zbyszek
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux