Skip to content

Instantly share code, notes, and snippets.

@majenkotech
Created September 3, 2024 13:18
Show Gist options
  • Save majenkotech/af15280aa5c78e2f9b2c9931b0e53cc8 to your computer and use it in GitHub Desktop.
Save majenkotech/af15280aa5c78e2f9b2c9931b0e53cc8 to your computer and use it in GitHub Desktop.
Systemd service file for ttyNVT connections to terminal servers.
# Filename: /etc/conf.d/ttynvt
ttyNVT0=192.168.1.23:3001
ttyNVT1=192.168.1.23:3002
ttyNVT2=192.168.1.23:3003
# Filename: /lib/systemd/system/ttynvt@.service
[Unit]
Description=Virtual network serial ports
After=local-fs.target
[Service]
EnvironmentFile=/etc/conf.d/ttynvt
ExecStart=-/usr/bin/ttynvt -f -n %i -r -S $%i
Type=simple
[Install]
WantedBy=multi-user.target
Start the ttynvt service with the key from the config file. That is used as the serial port name. The value associated
with the key is then used as the server to connect to.
# systemctl enable --now ttynvt@ttyNVT0
# systemctl enable --now ttynvt@ttyNVT1
# systemctl enable --now ttynvt@ttyNVT2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment