As when adding @ symbol to unit file, it will become a template unit file. Can I do:
sudo systemctl enable my-template@.service
? What will happen if I restarted the server? Would a new service get started using that template file? I need at least one service instance to start, but I am not familiar with template files best approach to solve this.
Any idea?
11 Answer
Template units aren't meaningful on their own, as they should contain variables like %i where specific identifiers are filled in.
You would then use a command like:
systemctl enable my-template@some-instanceExactly what this will be depends on what you have in your '[Instal]' section. See man systemd.unit for more about template units.