EDDN/systemd
Athanasius 0e3ef098ab systemd/start-eddn-service: Now replacing scripts/run-from-source.sh
* Removed scripts/run-from-source.sh as it's now redundant.
* Added `--background` optional argument, only for when using
  `--from-source` to start-eddn-service.  The script will leave the
  service in the foreground, no output redirection, without it.

  It tells you the PID of the process when it's backgrounded, as well as
  placing it in the appropriate .pid file.
2021-07-06 11:17:52 +00:00
..

systemd unit files for running EDDN services

eddn.target

This is a systemd target specifying that each of the services be run. Place it in /etc/systemd/system.

eddn@.service

This is a systemd template service file, negating the need for a separate file per service.

Place it in /etc/systemd/system. Edit it for:

  1. AssetPathExists - The path to where python setup.py install --user installed the files: eddn-gateway, eddn-monitor, eddn-relay.
  2. ExecStart - The path to where the wrapper scripts (see below) are installed. Probably the same path.
  3. The User and Group you need the services to run as.

Wrapper scripts

Each service is started by a wrapper script:

  • start-eddn-gateway
  • start-eddn-monitor
  • start-eddn-relay

Each of these utilises the file eddn_config for some basic configuration:

  • The config override file to be used.
  • The directory to redirect all output to.

Each script will start its service with output redirected to an appropriate file in the configured log directory, e.g.:

./eddn-gateway --config "${CONFIG_OVERRIDE}" >> "${LOG_DIR}/eddn-gateway.log" 2>&1