I am trying to run an API on an Orange Pi. It is running Ubuntu and the API process is running via Node.js Express.
I would like the process to automatically start running when the computer boots up, and I would like it to have sudo permissions.
This process can be done manually with sudo pm2 start process_name
, however this is not automatic.
I ran a command sudo chown orangepi:orangepi/.pm2/rpc.sock /home/orangepi/.pm2/pub.sock
but I'm not sure if it is behaving properly.
How would I get this process to start when the device is booted?
How do I grant this process permanent sudo permissions?
pm2.service
as example)/etc/systemd/system/
.enable the service:
If the 3rd command is error free system will load the service when booting.
You don't. "sudo" is only for your admin user. Not for systemd as this is done by root.