Zrok: How Do I Run Multiple Proxies Using as a Linux Service?

If anyone comes around and wants a sane alternative to getting multiple zrok services stood up, use the systemd service file below, you'll need to create the configs as previously stated. This service file should actually be used in the package installs..

/usr/lib/systemd/system/zrok-share@.service

[Unit]
Description=zrok reserved public share service
After=network-online.target

[Service]
Type=simple
DynamicUser=yes
StateDirectory=zrok-%i
UMask=0007
Environment=PFXLOG_NO_JSON=true
ExecStartPre=/opt/openziti/bin/zrok-enable.bash /opt/openziti/etc/zrok/zrok-%i.env
ExecStart=/opt/openziti/bin/zrok-share.bash /opt/openziti/etc/zrok/zrok-%i.env
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target

Then, just start the services like so

systemctl daemon-reload
systemctl enable zrok-share@share1
systemctl enable zrok-share@share2
systemctl start zrok-share@share1
systemctl start zrok-share@share1
1 Like