For reference, I'm using phpseclib to control a remote SSH server using the 'root' account.I have to start/stop a java process which is ran in the background. Stopping works fine with killall java and this is all I need for now, although when I run the server, I'm using:(cd ./serv/; nohup java -classpath bin:deps/poi.jar:deps/netty.jar:deps/mysql.jar:deps/slf4j.jar:deps/slf4j-nop.jar:deps/jython.jar:log4j-1.2.15.jar: server.Server &)As you can see, I am using the & operator for the second command inside the brackets. The command would execute correctly though the page would keep loading waiting for a return value/exit code? And it would eventually use up all the memory on my webhost.The answer was that you need to manually direct the output of nohup:Edit: Answer!!(cd ./serv/; java -classpath bin:deps/poi.jar:deps/netty.jar:deps/mysql.jar:deps/slf4j.jar:deps/slf4j-nop.jar:deps/jython.jar:log4j-1.2.15.jar: server.Server >/tmp/test.out 2>&1 &)Thanks to Mikeserv for the help.
How do I execute in background / return early?
shell;process;java;background process;nohup