Taking an exemple from scratch, the tty service.
At base, to start a tty, we need to do
# agetty -J 38400 tty7
here the daemon agetty is launch to control tty7 device. So, i can go to this tty7 is logon. Now if i want another tty, for instance 5, i need to do
# agetty -J 3800 tty5
This is the exact same line of code excepting the number at the end to target the desire tty.
Well come back to my service, i create the frontend file /etc/66/service/tty1
[main]
@type = classic
@description = "My first tty service for the tty5"
@version = 0.0.1
@user = ( root )
[start]
@execute = ( agetty -J 38400 tty1)
This is good enough to be able to do
# 66 start tty1
The service should be running. Now, if i want to do the same for the tty7, i need to create one more file /etc/66/service/tty7 with the same contents as tty5 but replacing the number 5 by 7 as follow
[main]
@type = classic
@description = "My first tty service for the tty7"
@version = 0.0.1
@user = ( root )
[start]
@execute = ( agetty -J 38400 tty7)
So, good but if i want the tty1 and 2 and 3, should i create one file for each one? This is where instantiated service come in place. Instantiated service are modified copy of original template for a service. In short (very short), that’s just “sed” command applied at creation time(A.K.A. parsing for 66) of the service.
Users need to be able to specify what they want to change to the original service, for this purpose we use a special syntax name to make distinction between the original file and the modified copy.
In short original@copy, where original is the name of the original frontend file and copy the name of the instantiated service.
In our case, it will be tty@. Naming my frontend file with that name with ‘@’ character at the end permit to 66 to recognize it as an original service file for future instantiated service.
Now, i need a way to specify to 66 what i want to change from the original frontend file (tty@ frontend file in our example). Do do so, on 66, i will employ the reserved string ‘@I’ inside my tty@ frontend file.
Well, my /etc/66/service/tty@ contents is now
[main]
@type = classic
@description = "My first tty service for the @I"
@version = 0.0.1
@user = ( root )
[start]
@execute = ( agetty -J 38400 @I)
Here i instruct 66 the place to make changes with the user request. The user request is given by the complete name of the instantiated service like so,
# 66 start tt@tty10
With this command, i request to 66 to create an instantiated service of the original frontend file tty@, to change the @I found inside the frontend by the name of copy, which is tty1 for us, and continue to do what it need to do to start the service.
So, when 66 keep information of the service before starting the service, from its point of view the frontend file of the service is
[main]
@type = classic
@description = "My first tty service for the tty10"
@version = 0.0.1
@user = ( root )
[start]
@execute = ( agetty -J 38400 tty10)
66 just has replaced the ‘@I’ found by tty10.
This way, we have one frontend file for many services.
no sure to understand the question here. Related as any other service. But what mean related for you