Tried this and it compiled without error but when starting slingd it just hangs. Command prompt never comes back even after hitting return several times. Have to Ctrl-C it. Any ideas what could be wrong?
did you try
slingd &
usually do that to get the prompt back.
More info:
why run a Linux shell command with &?
To get your prompt back immediately, and run the process in the background.
What are the function of them?
nohup allows the background process to continue running even after the user logs out (or exits the initiating shell).
>& redirects both standard output and standard error into the log file.
& runs the whole thing in the background, giving you your prompt back immediately.
Explanation:
Every Linux process opens three I/O channels, an input "stdin", a standard output "stdout" and a standard error output "stderr". They can be used for binary but are traditionally text. When most programs see stdin close, they exit (this can be changed by the programmer).
When the parent shell exits, stdin is closed on the children, and (often, usually) the children exit as well. In addition the children receive a software signal, SIGHUP, indicating the user has "hung up" (formerly, the modem) and the default here is to exit as well. (Note, a programmer can change all of this when writing the program).
So, what nohup does is give the child process a separate I/O environment, tying up the ins and outs to something not tied to the parent shell, and shielding the child from the SIGHUP signal. Once the user disconnects, you will see the nohup background process owned by init (process 1), not the user's shell.
However nohup cannot do the job completely if the process is run in the foreground, so & is used to run the program in the background, where it can happily stay running with or without a user logged in.
Thanks for the reply. I should have mentioned that when attempting to load / run the compiled slingd it uses 0% cpu and very very minimal memory with 0 connections after 20 hours with the same node list I'm using for my windows wallet. This is the same whether I start it in a screen session or run it as a background task