Autostart file when system turns on – ubuntu

Enable rc.local if missing

sudo touch /etc/rc.local
sudo chmod +x /etc/rc.local
sudo systemctl start rc-local
sudo systemctl status rc-local

Insert Your script command into rc.local, my was like below.
You can delete sample script. Just leave script headers.

aria2c --enable-rpc --rpc-listen-all --daemon --rpc-secret=XXXX=

Done.