<html><head></head><body><div class="ydp423ad0cdyahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div dir="ltr" data-setdir="false">Hello,</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false"><span class="ydp423ad0cdVIiyi" lang="en"><span class="ydp423ad0cdJLqJ4b ydp423ad0cdChMk0b" data-language-for-alternatives="en" data-language-to-translate-into="fr" data-phrase-index="0"><span>I am having problems with the aliases and "Alias=' directive related to the template service unit.</span></span></span></div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">According to https://www.freedesktop.org/software/systemd/man/systemd.unit.html<br></div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false"><div>> "A template instance may only be aliased by another template instance, and the instance part must be identical. A template may be aliased by another template (in which case the alias applies to all instances of the template). As a special case, a template instance (e.g. "alias@inst.service") may be a symlink to different template (e.g. "template@inst.service"). In that case, just this specific instance is aliased, while other instances of the template (e.g. "alias@foo.service", "alias@bar.service") are not aliased. Those rule preserve the requirement that the instance (if any) is always uniquely defined for a given unit and all its aliases."</div><div><br></div><div dir="ltr" data-setdir="false">I have exactly these two cases and requirements and cannot find example.</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">> "A template may be aliased by another template (in which case the alias applies to all instances of the template)"<br><br>eg: How to create an alias using `Alias=` for a service template core@.service which will have maybe 8 or 16 instances (eg: core@cpu01.service core@cpu02.service ..) which will apply to all instances when enabled using eg allcores@.service.<br><div><br></div><div>> "As a special case, a template instance (e.g. "alias@inst.service") may be a symlink to different template (e.g. "template@inst.service"). In that case, just this specific instance is aliased, while other instances of the template (e.g. "alias@foo.service", "alias@bar.service") are not aliased"<br><br>eg: How to create an alias using `Alias=` for a service template tailoutput@.service which will have maybe 2 instances (eg: tailoutput@tty11.service tailoutput@tty12.service ..) which will apply to only instance tailoutput@tty12.service when enabled using eg: tty12-tailoutput@tty12.service.<br><div><br></div><div>I can't apply any alias using "Alias=" directive for two different template .service unit.</div>Whatever I use for "Alias=" directive in the two cases inside the templates, instance service works, all symlink are created when instance is enabled, <span class="ydp423ad0cdVIiyi" lang="en"><span class="ydp423ad0cdJLqJ4b ydp423ad0cdChMk0b" data-language-for-alternatives="en" data-language-to-translate-into="fr" data-phrase-index="0"><span>instance services are started as expected using their names</span></span></span>, but all alias are always reporting<br>"Loaded: error (Reason: unit alasname failed to load properly: File exists)"<br></div></div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">Alias=allcores@.service<br><div>Alias=allcores@%i.service</div><div dir="ltr" data-setdir="false">Alias=alias@*.service</div><br>Alias=tty12-tailoutput@%i.service<br>Alias=%i-tailoutput@.service<br><div>Alias=alias@tty12.service</div><div dir="ltr" data-setdir="false">Alias=alias-%n<br></div><div><br></div><div dir="ltr" data-setdir="false">Thank you in advance.<br></div><div dir="ltr" data-setdir="false">Regards<br></div></div><br></div></div></body></html>