System install with systemd
For anything beyond a loopback trial you run rcfg-sim as systemd template services — one
instance per IP alias — with kernel and file-descriptor tuning applied. make install
handles all of it.
What make install does
Section titled “What make install does”sudo make installThis (re)builds the binaries and installs:
- Binaries into
/opt/rcfg-sim/ - The systemd template unit
rcfg-sim@.serviceinto/etc/systemd/system/ - A sysctl drop-in into
/etc/sysctl.d/(kernel tuning) - An FD-limits drop-in into
/etc/security/limits.d/ - Config under
/etc/rcfg-sim/(host key, per-instance env files)
A dedicated unprivileged service account (rcfgsim) runs the processes.
One instance per IP
Section titled “One instance per IP”The unit is a template (rcfg-sim@.service). The instance name is the IP the service
binds, and each instance reads its own environment file:
# Enable + start an instance bound to 10.50.0.1sudo systemctl enable --now rcfg-sim@10.50.0.1.service
# Status / logssystemctl status rcfg-sim@10.50.0.1.servicejournalctl -u rcfg-sim@10.50.0.1.service -fEach instance is independent — you can restart or drain one IP’s 2,500 ports without
touching the rest of the fleet. Configuration comes from /etc/rcfg-sim/<IP>.env (see
Running the server for the variables, modeled on
deploy/systemd/rcfg-sim-instance.env.sample).
Kernel tuning and limits
Section titled “Kernel tuning and limits”High-density listeners need a wider kernel envelope. The installed sysctl drop-in raises, among others:
fs.file-max(to ~2,000,000)net.core.somaxconnnet.ipv4.tcp_tw_reusenet.ipv4.ip_local_port_range(widened)- ARP table sizing for many local addresses
The limits drop-in sets nofile = 200000 for the rcfgsim user, and the unit sets
LimitNOFILE=200000. The unit also drains gracefully on stop (SIGTERM,
TimeoutStopSec=45s) so in-flight sessions finish cleanly.
Graceful shutdown
Section titled “Graceful shutdown”The service stops with a SIGTERM and a 45-second drain window. The server stops accepting new connections, lets active sessions complete, and exits — see Concurrency & graceful drain.
Uninstall
Section titled “Uninstall”sudo make uninstallStops and disables the units and removes the installed binaries and config drop-ins.
- Network setup — create the IP aliases the instances bind
- Generating configs — produce the manifest the server reads