Building eturnal From Source
View SourceRequirements
- Erlang/OTP (21.0 or newer).
- LibYAML (0.1.4 or newer).
- OpenSSL (1.0.0 or newer).
- GCC (other C compilers might work as well).
Note that you need the development headers of the libraries as well. Linux
distributions often put those into separate *-dev or *-devel packages. For
example, on DEB-based distributions you'd typically install libyaml-dev and
libssl-dev, on RPM-based distributions you'll probably need libyaml-devel
and openssl-devel.
Compilation
Note: If you build directly from the Git repository rather than using the official source tarball, you must download Rebar3 and make it executable (
chmod +x rebar3), first. On Erlang/OTP versions prior to 25.x, you need an older Rebar3 version (3.15.x on Erlang/OTP 21.x, otherwise 3.16.x).
curl https://eturnal.net/eturnal-1.12.2.tar.gz | tar -C /tmp -xzf -
cd /tmp/eturnal-1.12.2
./rebar3 as prod tar
This generates the archive file _build/prod/rel/eturnal/eturnal-1.12.2.tar.gz.
The default installation prefix is set to /opt/eturnal, and it's assumed the
server will be executed by a user named eturnal. To change these defaults,
edit the build.config file or override the settings using environment
variables (of the same name, but upper-case), re-run ./rebar3 as prod tar, and
adapt the following installation instructions accordingly.
Quick Test
The following command starts the server in an Erlang shell, using the configuration in config/eturnal.yml:
./rebar3 shell
To stop the server, enter q(). (including the trailing dot).
Installation
You'll need root privileges for the following commands. Therefore, call su -
or sudo -i, first.
Create a user for running eturnal. This step is of course only required if you're installing eturnal for the first time:
useradd -r -m -d /opt/eturnal eturnalOtherwise, create a backup of the old installation, first:
tar -czf /opt/eturnal-$(date '+%F').tar.gz /opt/eturnalExtract the archive generated above:
cd /opt/eturnal tar -xzf /tmp/eturnal-1.12.2/_build/prod/rel/eturnal/eturnal-1.12.2.tar.gz chown eturnal /opt/eturnal/etc/eturnal.ymlCopy the
eturnal.ymlfile to/etc(optional):cp -p -i /opt/eturnal/etc/eturnal.yml /etc/Start the systemd service:
cp /opt/eturnal/etc/systemd/system/eturnal.service /etc/systemd/system/ systemctl daemon-reload systemctl --now enable eturnal
Configuration and Usage
See the README.md file and the reference documentation for configuration and usage instructions.