Browse Source

Add systemd unit file and documentation

master
Johann Bauer 8 years ago
parent
commit
c578d8f500
  1. 37
      HOWTO.rst
  2. 11
      samples/systemd-unit

37
HOWTO.rst

@ -12,8 +12,8 @@ small - patches welcome.
communication with the daemon. I am using aiohttp-0.21.
While not requirements for running ElectrumX, it is intended to be run
with supervisor software such as Daniel Bernstein's daemontools, or
Gerald Pape's runit package. These make administration of secure
with supervisor software such as Daniel Bernstein's daemontools,
Gerald Pape's runit package or systemd. These make administration of secure
unix servers very easy, and I strongly recommend you install one of these
and familiarise yourself with them. The instructions below and sample
run scripts assume daemontools; adapting to runit should be trivial
@ -55,6 +55,10 @@ on an SSD::
mkdir /path/to/db_directory
chown electrumx /path/to/db_directory
Using daemontools
-----------------
Next create a daemontools service directory; this only holds symlinks
(see daemontools documentation). The 'svscan' program will ensure the
servers in the directory are running by launching a 'supervise'
@ -107,6 +111,35 @@ You can see its logs with::
tail -F /path/to/log/dir/current | tai64nlocal
Using systemd
-------------
This repository contains a sample systemd unit file that you can use to
setup ElectrumX with systemd. Simply copy it to :code:`/etc/systemd/system`::
cp samples/systemd-unit /etc/systemd/system/electrumx.service
The sample unit file assumes that the repository is located at
:code:`/home/electrumx/electrumx`. If that differs on your system, you need to
change the unit file accordingly.
You need to set a few configuration variables in :code:`/etc/electrumx.conf`,
see `samples/NOTES` for the list of required variables.
Now you can start ElectrumX using :code:`systemctl`::
systemctl start electrumx
You can use :code:`journalctl` to check the log output::
journalctl -u electrumx -f
Once configured, you may want to start ElectrumX at boot::
systemctl enable electrumx
Sync Progress
=============

11
samples/systemd-unit

@ -0,0 +1,11 @@
[Unit]
Description=Electrumx
After=network.target
[Service]
EnvironmentFile=/etc/electrumx.conf
ExecStart=/home/electrumx/electrumx/server_main.py
User=electrumx
[Install]
WantedBy=multi-user.target
Loading…
Cancel
Save