Running in the Background (Systemd Service Configuration Example)
The following example is based on Ubuntu 22.04/24.04 and demonstrates how to register xoned
as a systemd service to ensure automatic restarts, centralized logging, and more.
1. Create and Edit the Service Unit File
sudo vim /etc/systemd/system/xone-node.service
Paste the following content:
[Unit]
Description=Xone Node
After=network.target
[Service]
Type=simple
User=ubuntu
ExecStart=/usr/bin/xoned start
Restart=always
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target
2. Reload and Enable the Service
# Reload systemd configuration
sudo systemctl daemon-reload
# Enable the service to start on boot
sudo systemctl enable xone-node
3. Start the Service and Check Its Status
# Start the node service
sudo systemctl start xone-node
# View the service’s status
sudo systemctl status xone-node
4. View Real‑Time Logs
# Follow the journal logs for the service
sudo journalctl -f -u xone-node
5. Common Maintenance Commands
-
Restart the service
sudo systemctl restart xone-node
-
Stop the service
sudo systemctl stop xone-node
-
Disable auto‑start on boot
sudo systemctl disable xone-node
-
View the last 100 lines of logs
sudo journalctl -u xone-node -n 100
Once configured, your Xone Chain node will run as a daemon in the background, automatically recover after system reboots or failures, and provide easy log inspection and troubleshooting via journalctl
.