Article 521P3 Systemd custom service

Systemd custom service

by
JJJCR
from LinuxQuestions.org on (#521P3)
Hi guys, to list all services in systemd is to just type: systemctl and press enter.

For custom services it will have an customName@service.blah.blah

Like this article below from this link: https://wiki.archlinux.org/index.php/systemd

Quote:
Note: Some unit names contain an @ sign (e.g. name@string.service): this means that they are instances of a template unit, whose actual file name does not contain the string part(e.g. name@.service). string is called the instance identifier, and is similar to an argument that is passed to the template unit when called with the systemctl command: in the unit file it will substitute the %i specifier. To be more accurate, before trying to instantiate the name@.suffix template unit, systemd will actually look for a unit with the exact name@string.suffix file name, although by convention such a "clash" happens rarely, i.e. most unit files containing an @ sign are meant to be templates. Also, if a template unit is called without an instance identifier, it will just fail, since the %i specifier cannot be substituted
My question is, how to stop or restart the custom service by calling the service name.

Example if the name is like this: javaservice@name.service

The command to restart would be like this:

systemctl restart javaservice

It will be like that? Or how do we find the exact name to call the custom service?

Thank you.latest?d=yIl2AUoC8zA latest?i=wbHh0kaoJDE:FOyVCOFqEbw:F7zBnMy latest?i=wbHh0kaoJDE:FOyVCOFqEbw:V_sGLiP latest?d=qj6IDK7rITs latest?i=wbHh0kaoJDE:FOyVCOFqEbw:gIN9vFwwbHh0kaoJDE
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments