[Unit] Description=Monero Daemon Documentation=https://docs.getmonero.org/running-node/monerod-systemd/ After=network-online.target Wants=network-online.target # The blockchain lives on a separate 500 GB disk mounted at {{ monero_data_dir }}. # Without this line a failed mount would not stop monerod - it would start, find # an empty directory, and begin writing a ~300 GB chain onto the 10 GB root # filesystem. This turns that silent disaster into a unit that refuses to start, # which the systemd monitor reports within five minutes. RequiresMountsFor={{ monero_data_dir }} [Service] Type=simple User={{ monero_user }} Group={{ monero_group }} ExecStart={{ monero_bin_dir }}/monerod --config-file {{ monero_conf_dir }}/monerod.conf --non-interactive Restart=always RestartSec=30 # monerod flushes LMDB on shutdown and that is not instant on a full chain. # Killing it mid-flush is how the database gets corrupted and resynced from zero. TimeoutStopSec=300 StandardOutput=journal StandardError=journal # Hardening: the daemon only ever writes to its own data and log directories. NoNewPrivileges=true PrivateTmp=true ProtectSystem=strict ProtectHome=read-only ReadWritePaths={{ monero_data_dir }} {{ monero_log_dir }} LimitNOFILE=65535 [Install] WantedBy=multi-user.target