Skip to content
Snippets Groups Projects
Commit abfeed02 authored by David Trattnig's avatar David Trattnig
Browse files

Updated docs for Systemd and Supervisor. #21

parent 9c4ad56a
No related branches found
No related tags found
No related merge requests found
Pipeline #874 passed
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
- [Configuration](#configuration) - [Configuration](#configuration)
- [Running Engine](#running-engine) - [Running Engine](#running-engine)
- [Running with Systemd](#running-with-systemd) - [Running with Systemd](#running-with-systemd)
- [Combined Unit for Engine Core and Liquidsoap](#combined-unit-for-engine-core-and-liquidsoap) - [Run the Engine with a single command](#run-the-engine-with-a-single-command)
- [Individual Units for Engine Core and Liquidsoap](#individual-units-for-engine-core-and-liquidsoap) - [Individual Units for Engine Core and Liquidsoap](#individual-units-for-engine-core-and-liquidsoap)
- [Running with Supervisor](#running-with-supervisor) - [Running with Supervisor](#running-with-supervisor)
- [Logging](#logging) - [Logging](#logging)
...@@ -149,7 +149,7 @@ In your production environment edit following file to configure the engine: ...@@ -149,7 +149,7 @@ In your production environment edit following file to configure the engine:
engineuser:/opt/aura/engine$ nano /etc/aura/engine.ini engineuser:/opt/aura/engine$ nano /etc/aura/engine.ini
``` ```
Now, specify at least following settings to get started: Now, specify at least the following settings to get started:
```ini ```ini
[database] [database]
...@@ -158,7 +158,7 @@ Now, specify at least following settings to get started: ...@@ -158,7 +158,7 @@ Now, specify at least following settings to get started:
db_pass="---SECRET--PASSWORD---" db_pass="---SECRET--PASSWORD---"
``` ```
Set the URLs to the *Steering*, *Tank* and *Engine* API: Define the API URLs to the *Steering*, *Tank* and *Engine API*:
```ini ```ini
[api] [api]
...@@ -225,54 +225,41 @@ For this you can utilize either [Systemd](https://systemd.io/) or [Supervisor](h ...@@ -225,54 +225,41 @@ For this you can utilize either [Systemd](https://systemd.io/) or [Supervisor](h
### Running with Systemd ### Running with Systemd
Copy the unit files in `/opt/aura/engine/config/systemd/aura-engine.service` to your systemd unit directory,
#### Combined Unit for Engine Core and Liquidsoap and reload the systemd daemon:
Copy the unit file `/opt/aura/engine/config/systemd/aura-engine.service` to `/etc/systemd/system/`.
This unit file starts engine-core and engine-liquidsoap within one command. Here Liquidsoap is started as
as subprocess. For more fine-grained control the units in the next section are recommended instead.
Now you'll need to reload the Systemd unit files
```shell ```shell
sudo systemctl daemon-reload cp /opt/aura/engine/config/systemd/* /etc/systemd/system/
systemctl daemon-reload
``` ```
**Start** #### Run the Engine with a single command
```shell
sudo systemctl start aura-engine
```
**Stop** This unit file starts engine-core and engine-liquidsoap within one command. Here Liquidsoap is started as
as subprocess. For more fine-grained control the units in the next section are recommended instead.
```shell
sudo systemctl start aura-engine
```
**Restart** The most common way to start the engine is using the combined command which starts Liquidsoap (`aura-engine-lqs`)
and the Engine Core:
```shell ```shell
sudo systemctl restart aura-engine systemctl start aura-engine
``` ```
**Status** Now you are able to stop and restart the scheduler without affecting the playout of Liquidsoap. Note, Liquidsoap
will play as long it has already scheduled data for the current timeslot. If it doesn't it will still the defined
station fallback scenario.
```shell ```shell
sudo systemctl status aura-engine systemctl restart aura-engine
systemctl stop aura-engine
systemctl status aura-engine
``` ```
#### Individual Units for Engine Core and Liquidsoap #### Individual Units for Engine Core and Liquidsoap
Copy the unit files `/opt/aura/engine/config/systemd/aura-engine-lqs.service` and If you prefer to start both Engine components individually you can use the units `aura-engine-core` and
`/opt/aura/engine/config/systemd/aura-engine-core.service` to `/etc/systemd/system/`. `aura-engine-lqs`. But keep in mind there is no dependency between those units. If you start Engine Core
the Liquidsoap part will not be started by itself and vice versa.
Now you'll need to reload the Systemd unit files
```shell
sudo systemctl daemon-reload
```
**Start Liquidsoap and check its status** **Start Liquidsoap and check its status**
...@@ -294,7 +281,6 @@ sudo systemctl status aura-engine-core ...@@ -294,7 +281,6 @@ sudo systemctl status aura-engine-core
sudo journalctl -f sudo journalctl -f
``` ```
### Running with Supervisor ### Running with Supervisor
Now, given you are in the engine's home directory `/opt/aura/engine/`, simply type following to start Now, given you are in the engine's home directory `/opt/aura/engine/`, simply type following to start
...@@ -307,7 +293,7 @@ supervisord ...@@ -307,7 +293,7 @@ supervisord
This picks up the supervisor configuration provided in the local `supervisord.conf` and the service configurations This picks up the supervisor configuration provided in the local `supervisord.conf` and the service configurations
located in `config/supervisor/*.conf`. located in `config/supervisor/*.conf`.
Experience has shown it might be helpful to reload the supervisor configuration using `sudo`: Then you'll need to reload the supervisor configuration using `sudo`:
```shell ```shell
sudo supervisorctl reload sudo supervisorctl reload
...@@ -326,7 +312,7 @@ You should get these all services with their actual state listed: ...@@ -326,7 +312,7 @@ You should get these all services with their actual state listed:
```c++ ```c++
aura-engine in use auto 666:666 aura-engine in use auto 666:666
aura-engine-api in use auto 999:999 aura-engine-lqs in use auto 999:999
``` ```
**Maintanence using Supervisor** **Maintanence using Supervisor**
...@@ -334,32 +320,15 @@ aura-engine-api in use auto 999:999 ...@@ -334,32 +320,15 @@ aura-engine-api in use auto 999:999
Please remember to call all `supervisorctl` commands from within your engine home directory (`/opt/aura/engine/`), Please remember to call all `supervisorctl` commands from within your engine home directory (`/opt/aura/engine/`),
to pickup the correct `supervisord.conf`. to pickup the correct `supervisord.conf`.
**Starting Services** **Starting, stopping and restarting a service**
```shell ```shell
supervisorctl start <service-name> supervisorctl start <service-name>
```
**Stopping Services**
```shell
supervisorctl stop <service-name> supervisorctl stop <service-name>
```
**Restarting Services**
```shell
supervisorctl restart <service-name>
```
**Refresh after changing configurations**
```shell
supervisorctl restart <service-name> supervisorctl restart <service-name>
``` ```
In case you want to reload whole supervisor service **Reloading the whole supervisor service**
```shell ```shell
sudo service supervisor restart sudo service supervisor restart
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment