rathole/examples/systemd
Yujia Qiao fc0ee93ef0
docs: use formal tone
2022-01-05 19:20:17 +08:00
..
README.md docs: use formal tone 2022-01-05 19:20:17 +08:00
rathole@.service feat: add systemd unit files 2021-12-25 18:23:13 +08:00
ratholec.service feat: add systemd unit files 2021-12-25 18:23:13 +08:00
ratholec@.service feat: add systemd unit files 2021-12-25 18:23:13 +08:00
ratholes.service feat: add systemd unit files 2021-12-25 18:23:13 +08:00
ratholes@.service feat: add systemd unit files 2021-12-25 18:23:13 +08:00

README.md

Systemd Unit Examples

The directory lists some systemd unit files for example, which can be used to run rathole as a service on Linux.

The @ symbol in name of unit files such as rathole@.service facilitates the management of multiple instances of rathole.

For the naming of the example, ratholes stands for rathole --server, and ratholec stands for rathole --client, rathole is just rathole.

Assuming that rathole is installed in /usr/local/bin/rathole, and the configuration file is in /etc/rathole/app1.toml, the following steps shows how to run an instance of rathole --server.

  1. Create a service file.
sudo cp ratholes@.service /etc/systemd/system/
  1. Create the configuration file app1.toml.
sudo mkdir -p /etc/rathole
# And create the configuration file named `app1.toml` inside /etc/rathole
  1. Enable and start the service
sudo systemctl daemon-reload # Make sure systemd find the new unit
sudo systemctl enable ratholes@app1 --now

And if there's another configuration named app2.toml in /etc/rathole, then sudo systemctl enable ratholes@app2 --now can start an instance for that configuration.

The same applies to rathole --client and rathole.