Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance showing units' templates #11269

Closed
marusak opened this issue Feb 28, 2019 · 3 comments
Closed

Enhance showing units' templates #11269

marusak opened this issue Feb 28, 2019 · 3 comments

Comments

@marusak
Copy link
Member

marusak commented Feb 28, 2019

Page: Services
Came from #11241
In services page under Services or Timers there can be templates which are always a bit odd as do not have Status nor Automatic Startup. Also there is different behavior upon clicking on them. Also picking any startup option different than All hides all of them.

There are some ideas how to do this:

  • Create another type next to Paths (But it is not really another type, it can be timer or service)
  • Drop them into another table (This would be step back as Services filtering and other stuff #11241 removes splitting into tables)
  • Introduce auto start option Templates - which is kinda weird to have it there and also it would not solve problem that templates look odd in the table (especially in timers table)
@andreasn
Copy link
Contributor

andreasn commented Mar 1, 2019

So how does templates actually work? What's a workflow where I need to use them?

@marusak
Copy link
Member Author

marusak commented Mar 1, 2019

So I am not expert in this, but I will try to explain it as best as I can :)

Template is almost normal unit except it takes one variable - that both uniquely identifies the unit (it is in it's name/id) and also can be used inside the unit as argument. In that case you can create bunch of units that differ just a bit (where you use the variable inside unit - All %i in unit file are replaced by the argument you instantiate it with). And then each of those units behaves like normal unit that you can start, stop, enable, disable...

For a real user problem see for example this.
Or for example you can run multiple httpd services by using templates - see https://www.mankier.com/8/httpd.service#Description-Instantiated_services

If you want to see some instantianted services search for "getty" in services page. Then hit 'ctrl+alt+f4' login and jump back and see that now you have there also getty@tty4.service

@marusak
Copy link
Member Author

marusak commented Sep 4, 2020

Replaced by #14549

@marusak marusak closed this as completed Sep 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants