4
0
Эх сурвалжийг харах

Add systemd service and relevant documentation

Serena Willis 2 жил өмнө
parent
commit
075be5eaad
2 өөрчлөгдсөн 75 нэмэгдсэн , 0 устгасан
  1. 22 0
      config/ras.service
  2. 53 0
      docs/SYSTEMD.md

+ 22 - 0
config/ras.service

@@ -0,0 +1,22 @@
+[Unit]
+Description=Retro AIM Server
+
+[Service]
+Type=simple
+User=ras
+Group=ras
+Environment="ALERT_PORT=5194"
+Environment="AUTH_PORT=5190"
+Environment="BOS_PORT=5191"
+Environment="CHAT_NAV_PORT=5193"
+Environment="CHAT_PORT=5192"
+Environment="DB_PATH=/var/ras/oscar.sqlite"
+Environment="DISABLE_AUTH=true"
+Environment="FAIL_FAST=false"
+Environment="LOG_LEVEL=info"
+Environment="OSCAR_HOST=127.0.0.1"
+ExecStart=/opt/ras/bin/retro_aim_server
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target

+ 53 - 0
docs/SYSTEMD.md

@@ -0,0 +1,53 @@
+# Configuring Retro AIM Server With systemd
+
+This document details the configuration of Retro AIM Server to run as an unprivileged user with `systemd` managing it as a production service.
+
+1. ** Download Retro AIM Server**
+
+   Grab the latest Linux release from the [releases page](https://github.com/mk6i/retro-aim-server/releases)
+
+2. ** Create the ras user and group **
+
+   Run the following commands:
+
+   ```shell
+   $ sudo useradd ras
+   $ sudo mkdir -p /opt/ras
+   $ sudo mkdir -p /var/ras
+   ```
+
+3. ** Extract the archive **
+
+   Extract the archive using the usual `tar` invocation, and move the extracted contents into `/opt/ras`
+
+4. ** Set Ownership and Permissions **
+
+   ```shell
+   $ sudo chown -R ras:ras /opt/ras
+   $ sudo chmod -R o-rx /opt/ras
+   ```
+
+5. ** Copy the systemd service **
+
+   Place the `ras.service` file in `/etc/systemd/system`
+
+6. ** Reload systemd **
+
+   ```shell
+   $ sudo systemctl daemon-reload
+   ```
+
+7. ** Enable and start the service **
+
+  ```shell
+  $ sudo systemctl enable --now ras.service
+  ```
+
+8. ** Make sure the service is running **
+
+   ```shell
+   $ sudo systemctl status ras.service
+   $ sudo journalctl -xeu ras.service
+   ```
+
+Note that the `systemd` service defines the configuration for Retro AIM Server directly, bypassing the usual `run.sh` script and `settings.env`. Customizations may be performed in `/etc/systemd/system/ras.service`.