systemd: Update for system install
While these unit files were good for a user install, they were not appropriate for running *system* services. Since most users nowadays use `rad node` to manage their node, it makes more sense for the unit files to be oriented towards server use.
This commit is contained in:
parent
137961c1f7
commit
292ff01923
|
|
@ -3,23 +3,21 @@
|
||||||
# When running radicle-httpd on a server, it should be run as a separate user.
|
# When running radicle-httpd on a server, it should be run as a separate user.
|
||||||
#
|
#
|
||||||
# Copy this file into /etc/systemd/system and set the User/Group parameters
|
# Copy this file into /etc/systemd/system and set the User/Group parameters
|
||||||
# under [Service] appropriately, or copy it into the user's systemd directory.
|
# under [Service] appropriately, as well as the `RAD_HOME` environment variable.
|
||||||
#
|
|
||||||
# For example:
|
|
||||||
#
|
|
||||||
# mkdir -p $HOME/.config/systemd/user/
|
|
||||||
# cp radicle-node.service $HOME/.config/systemd/user/radicle-node.service
|
|
||||||
#
|
#
|
||||||
[Unit]
|
[Unit]
|
||||||
After=syslog.target network.target
|
Description=Radicle HTTP Daemon
|
||||||
Description=Radicle HTTPd
|
After=network.target network-online.target
|
||||||
|
Requires=network-online.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=%h/.radicle/bin/radicle-httpd --listen 127.0.0.1:8080
|
User=seed
|
||||||
Environment=RAD_HOME=%h/.radicle RUST_BACKTRACE=1 RUST_LOG=info
|
Group=seed
|
||||||
|
ExecStart=/usr/local/bin/radicle-httpd --listen 127.0.0.1:8080
|
||||||
|
Environment=RAD_HOME=/home/seed/.radicle RUST_BACKTRACE=1 RUST_LOG=info
|
||||||
KillMode=process
|
KillMode=process
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=1
|
RestartSec=1
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=default.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
||||||
|
|
@ -3,32 +3,28 @@
|
||||||
# When running radicle-node on a server, it should be run as a separate user.
|
# When running radicle-node on a server, it should be run as a separate user.
|
||||||
#
|
#
|
||||||
# Copy this file into /etc/systemd/system and set the User/Group parameters
|
# Copy this file into /etc/systemd/system and set the User/Group parameters
|
||||||
# under [Service] appropriately, or copy it into the user's systemd directory.
|
# under [Service] appropriately, as well as the `RAD_HOME` environment variable.
|
||||||
#
|
|
||||||
# For example:
|
|
||||||
#
|
|
||||||
# mkdir -p $HOME/.config/systemd/user/
|
|
||||||
# cp radicle-node.service $HOME/.config/systemd/user/radicle-node.service
|
|
||||||
#
|
#
|
||||||
# If your Radicle key is passphrase-protected, you will have to set the
|
# If your Radicle key is passphrase-protected, you will have to set the
|
||||||
# RAD_PASSPHRASE environment variable to the passphrase supplied during
|
# `RAD_PASSPHRASE` environment variable to the passphrase supplied during
|
||||||
# `rad auth`, eg.
|
# `rad auth`, eg.
|
||||||
#
|
#
|
||||||
# [Service]
|
# [Service]
|
||||||
# Environment=RAD_PASSPHRASE=snickerdoodle
|
# Environment=RAD_PASSPHRASE=snickerdoodle
|
||||||
#
|
#
|
||||||
# Also ensure RAD_HOME is set appropriately.
|
|
||||||
#
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Radicle Node
|
Description=Radicle Node
|
||||||
After=syslog.target network.target
|
After=network.target network-online.target
|
||||||
|
Requires=network-online.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=%h/.radicle/bin/radicle-node --listen 0.0.0.0:8776 --force
|
User=seed
|
||||||
Environment=RAD_HOME=%h/.radicle RUST_BACKTRACE=1 RUST_LOG=info
|
Group=seed
|
||||||
|
ExecStart=/usr/local/bin/radicle-node --listen 0.0.0.0:8776 --force
|
||||||
|
Environment=RAD_HOME=/home/seed/.radicle RUST_BACKTRACE=1 RUST_LOG=info
|
||||||
KillMode=process
|
KillMode=process
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=3
|
RestartSec=3
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=default.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue