By info906663
I’ve got a negroni server (for Go) running on CentOS and have an nginx proxy set up as well. When the command line ssh connection to my DigitalOcean server is open, the server works and I can call the endpoints, but as soon as I close it, it’s like the server shuts down or something! I can no longer get any responses…
Just to provide more information: the way I start the server is by doing “go install myApp” and then “myApp &” to start the server…
Any ideas what I’m missing?
Any help is much appreciated, thank you in advance!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi,
You will know if your server shuts down if you could no longer contact it using ping or ssh, among others.
Reading your situation, my best guess was that your GO app stopped running because:
You run it using a user account that logged in on a TTY. But once the user account logs out (as in your case, i.e., you closed your SSH connection) or the TTY session closes, all child processes that are run by that user on that particular session will be stopped too even when you specifically said that a process should continue running the background (&).
In order to continue running a process in the background for a user logged in on a terminal (TTY), you could run the command with nohup. So in your case, it would be:
nohup myApp &
Try it out.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.