This is not always a problem, but when I use the boost: asio service to install it as a Linux service, I use newlisp (exec "service data_service start ") when I started it, I found that newlisp would be suspended. I have mentioned this question in the newlisp community until I forget that no one answered this question. :(
However, when I encountered this problem again today, I decided to solve it myself. First, I guess there was a problem with the service Startup Script.
It turns out that there is a row in/etc/init. d/data-service.
./Data_service./config. xml &
The data_service script file runs normally on the terminal.
But http://stackoverflow.com/questions/4797050/how-to-run-process-as-background-and-never-die after reading this post
Remember, I used nohup before and tried it.
nohup ./data_service_d ./config.xml > /dev/null 2>&1 &
Okay. The problem is solved.
Here:
nohup means: Do not terminate this process even when the stty is cut off.> /dev/null means: stdout goes to /dev/null (which is a dummy device that does not record any output).2>&1 means: stderr also goes to the stdout (which is already redirected to /dev/null).& at the end means: run this command as a background task.