From a56c5e6ba8d8a3cc3005275a5d6d69f9c4f4ed28 Mon Sep 17 00:00:00 2001 From: Antonios Hadjigeorgalis Date: Tue, 26 Sep 2017 17:53:05 -0400 Subject: [PATCH] Updated systemd files for linux (#6592) Previous version put $BASE directory in root directory. This version clearly explains how to run as root or as specific user. Additional configuration: * send SIGHUP for clean exit, * restart on fail. Tested on Ubuntu 16.04.3 LTS with 4.10.0-33-generic x86_64 kernel --- scripts/parity.service | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/parity.service b/scripts/parity.service index 31d9011ea..1af907234 100644 --- a/scripts/parity.service +++ b/scripts/parity.service @@ -3,8 +3,18 @@ Description=Parity Daemon After=network.target [Service] -EnvironmentFile=-%h/.parity/parity.conf -ExecStart=/usr/bin/parity $ARGS +# run as root, set base_path in config.toml +ExecStart=/usr/bin/parity --config /etc/parity/config.toml +# To run as user, comment out above and uncomment below, fill in user and group +# picks up users default config.toml in $HOME/.local/.share/io.parity.ethereum/ +# User=username +# Group=groupname +# ExecStart=/usr/bin/parity +Restart=on-failure + +# Specifies which signal to use when killing a service. Defaults to SIGTERM. +# SIGHUP gives parity time to exit cleanly before SIGKILL (default 90s) +KillSignal=SIGHUP [Install] WantedBy=default.target