I just migrated a web application from NodeJS to Go, and I am having troubles getting it to run on startup. Previously using my Node app, I would use pm2 to handle starting the app. However I cannot find a good way to do this with Go.
I have looked into making my own service with rc.d
but I can't really find anything that helpful. Is there an easy way to do this? I can compile the source code to binary if need be.
At the moment I have it just running in a TTY, but I would really like it to be a daemon.
Edit: Just to clarify, I am using NGiNX to reverse proxy the Go app.
nginx
package is installed with its own/etc/rc.d/nginx
file. What is the issue with enabling and starting this usingrcctl enable nginx; rcctl start nginx
as root? – Kusalananda Feb 08 '22 at 11:28