From 2cc0a3f7665fc2b7251a8ac468594d594cf29aff Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sat, 15 Apr 2023 20:32:54 -0700 Subject: new systemd monerod@.service template unit, enabled monerod@xyz.service, remove `BindsTo=mullvad-daemon.service` --- etc/systemd/system/monerod@.service | 16 ++++++++++++++++ .../multi-user.target.wants/monerod@xyz.service | 1 + usr/lib/systemd/system/monerod.service | 22 +++++++--------------- 3 files changed, 24 insertions(+), 15 deletions(-) create mode 100644 etc/systemd/system/monerod@.service create mode 120000 etc/systemd/system/multi-user.target.wants/monerod@xyz.service diff --git a/etc/systemd/system/monerod@.service b/etc/systemd/system/monerod@.service new file mode 100644 index 00000000..0dfd9e70 --- /dev/null +++ b/etc/systemd/system/monerod@.service @@ -0,0 +1,16 @@ +[Unit] +Description=Monero Full Node for user %I +After=network.target + +[Service] +User=%i + +Type=simple +ExecStart=/usr/bin/monerod --non-interactive +StandardOutput=null +StandardError=null + +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/etc/systemd/system/multi-user.target.wants/monerod@xyz.service b/etc/systemd/system/multi-user.target.wants/monerod@xyz.service new file mode 120000 index 00000000..136953f4 --- /dev/null +++ b/etc/systemd/system/multi-user.target.wants/monerod@xyz.service @@ -0,0 +1 @@ +/etc/systemd/system/monerod@.service \ No newline at end of file diff --git a/usr/lib/systemd/system/monerod.service b/usr/lib/systemd/system/monerod.service index fbf3a2eb..63daefa8 100644 --- a/usr/lib/systemd/system/monerod.service +++ b/usr/lib/systemd/system/monerod.service @@ -1,24 +1,16 @@ [Unit] Description=Monero Full Node -After=mullvad-daemon.service -# I do not fully understand all the options -#PartOf=mullvad-daemon.service -#Requisite=mullvad-daemon.service -# from tests, BindsTo will override Requisite? Why? -# BindsTo is stronger than PartOf -# https://pychao.com/2021/02/24/difference-between-partof-and-bindsto-in-a-systemd-unit/ -BindsTo=mullvad-daemon.service -# StopPropagatedFrom functionality seems included in PartOf? -# from tests, StopPropagatedFrom also propagate restart? Why? -# difference between StopPropagatedFrom and BindsTo: -# https://github.com/systemd/systemd/commit/ffec78c05bfc2e6458e05ee54256d0d766a36280 -#StopPropagatedFrom=mullvad-daemon.service +After=network.target [Service] -User=xyz +User=monero +Group=monero +WorkingDirectory=~ +StateDirectory=monero +LogsDirectory=monero Type=simple -ExecStart=/usr/bin/monerod --non-interactive +ExecStart=/usr/bin/monerod --config-file /etc/monerod.conf --non-interactive StandardOutput=null StandardError=null -- cgit v1.2.3-70-g09d2