-
Notifications
You must be signed in to change notification settings - Fork 1
NOMAD Client Service
Dan Davies edited this page Oct 1, 2025
·
1 revision
We run the nomad client as a Linux service so it starts automatically at startup.
In /etc/systemd/system/nomad-client.service:
[Unit]
Description=Nomad Spect Client task
After=network.target
[Service]
Type=simple
User=nmrsu
WorkingDirectory=/opt/nomad-spect-client
# Set PATH to the exact nvm version's bin:
Environment=PATH=/home/nmrsu/.nvm/versions/node/v20.12.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
# Run bash file (see below) directly:
ExecStart=/home/nmrsu/bin/nomad-client
# Get the service to attempt a restart on failure
Restart=on-failure
RestartSec=2s
[Install]
WantedBy=multi-user.target
Then in ~/bin/nomad-client:
#!/usr/bin/env bash
/home/nmrsu/.nvm/versions/node/v20.12.2/bin/npm run verbose --prefix /opt/nomad-spect-client
Ensure the above file is executable e.g. chmod +x ~/bin/nomad-client.
To start, stop, view status:
sudo systemctl start nomad-client
sudo systemctl stop nomad-client
sudo systemctl status nomad-clientTo make sure it runs when the system reboots:
sudo systemctl enable nomad-clientTo view the logs, run:
sudo journalctl -u nomad-client