Starting ALGOD as systemd Service

I got the node installed and works fine, but I have to manually start the node. I followed the instruction Installing algod as a systemd service at Install a node - Algorand Developer Portal
./systemd-setup.sh, but I can’t seem to get it to auto-start on boot. Please help.

My node is installed using quick-algo script from Use Quick-Algo to Start Running an Algorand Node in Under 1 Minute | Algorand Developer Portal.

Node folder: /home/itchibahn/node
User: itchibahn
Group: itchibahn

I’ve ran ./systemd-setup.sh itchibahn itchibahn /home/itchibahn/node (I’ve also tried as root:root)
which created /lib/systemd/system/algorand@.service

[Unit]
Description=Algorand daemon under %I
After=network.target
AssertPathExists=%I

[Service]
ExecStartPre=bash -c "[[ ! -f %I/system.json ]] && echo '{\"shared_server\":true,\"systemd_managed\":true}' > %I/system.json || :"
ExecStart=/home/itchibahn/node/algod -d %I
User=itchibahn
Group=itchibahn
Restart=always
RestartSec=5s
ProtectSystem=false

[Install]
WantedBy=multi-user.target

What error are you seeing?
Does it start manually when you run:

sudo systemctl start algorand@$(systemd-escape $ALGORAND_DATA)

(assuming $ALGORAND_DATA is properly set)

or

sudo systemctl start algorand

If yes, you just need need to enable the service at boot using the above command replacing start with enable. See How To Use Systemctl to Manage Systemd Services and Units | DigitalOcean

2 Likes

Thank you for a reply.

I’m not getting any error message on “sudo systemctl start algorand”, and didn’t work.
But “sudo systemctl enable algorand@$(systemd-escape $ALGORAND_DATA)” did the trick.

Thanks !!!