One systemd Unit File, Many Instances: Template Units (with frp as the Example)
I needed one machine to connect to three different frp servers. Most tutorials solve this by copying frpc.service three times and editing the path in each. Change one parameter and you have to remember to change it in three files — that breaks eventually. systemd has a built-in answer: template units. Write frpc@.service once, then spin up as many instances as you like. This post walks through the full frp setup first, then shows how the same pattern applies to xray, socat, Python scripts, or anything else you need to run several copies of. ...