Issue running multiple Gateway Bridges

I’m trying to run multiple Gateway Bridges on a single server instance by duplicating the systemd service. Unfortunately I’m getting an error every time I try to start the second instance.
This is the error message:

This is my service file:

[Unit]
Description=ChirpStack Gateway Bridge US
Documentation=https://www.chirpstack.io/
Wants=network-online.target
After=network-online.target

[Service]
User=gatewaybridge
Group=gatewaybridge
ExecStart=/usr/bin/chirpstack-gateway-bridge-us -c /etc/chirpstack-gateway-bridge/chirpstack-gateway-bridge_us.toml
Restart=on-failure

[Install]
WantedBy=multi-user.target
Alias=lora-gateway-bridge-new.service

The service runs fine when I stop the normal Gateway Bridge first. If I then try to start it again, it exits with the same error. Any idea what I’m missing?

Thanks!

Which install did you do? Ubuntu? I recommend you try the docker install for easily spinning up multiple services. It also transitions nicely into high availability methods.

1 Like

It’s running on a Debian Container. Since it is already productive, I cannot change environments right now.

I have very little idea knowledge about using systemd, but looking at the other post you commented on, the example Brocaar linked has a different ExecStart than yours:

[Service]
User=gatewaybridge
Group=gatewaybridge
ExecStart=/usr/bin/chirpstack-gateway-bridge
Restart=on-failure

Assuming you created the seperate chirpstack-gateway-bridge-us file did you try it with:

ExecStart=/usr/bin/chirpstack-gateway-bridge-us

The only other other advice I can give is that you can backup and restore your chirpstack databases. So if your worry about trying docker was with losing the info/sessions, you could easily backup your current postgres database and load it into a new docker install, keeping all your devices, profiles, and most importantly device sessions. Then repoint your gateways (or change the servers DNS’) to the docker server and it would continue running seamlessly with essentially no downtime. If you are curious how to do this I can help, otherwise good luck with the Debian.

Assuming you created the seperate chirpstack-gateway-bridge-us file did you try it with:

ExecStart=/usr/bin/chirpstack-gateway-bridge-us

I did try that and all possible permutations of servces, .toml and order.

The only thing that has worked so far is starting the second gateway straight from the console, without systemctl. So it appears this is an issue with systemd.

Thanks for your help anyway, I hope somebody has gotten this to work recently and might know what’s going wrong.

For anyone running into the same issue: The problem was due to insufficient permissions on the .toml file. Since I’ve created them with root privileges they were not available for the user and group “gatewaybridge” as specified in the .service file.

chown and chgrp managed to fix it and now it runs perfectly. This explains why it started correctly from the terminal as root. Though I am not sure why it ran as a service, when the original gatewaybridge was stopped.