[Unit]
Description=Electroneum Full Node
After=network.target

[Service]
User=electroneum
Group=electroneum
WorkingDirectory=~
Type=forking
# create pid dir with root permission
PermissionsStartOnly=true
ExecStartPre=-/usr/bin/mkdir /var/run/electroneum
ExecStartPre=/usr/bin/chown -R electroneum:electroneum /var/run/electroneum/
PIDFile=/var/run/electroneum/electroneumd.pid
# start service
ExecStart=/usr/bin/electroneumd --config-file /etc/electroneumd.conf \
    --detach --pidfile /var/run/electroneum/electroneumd.pid

[Install]
WantedBy=multi-user.target