I have a problem with the server. I want to start the server in the background from R (which works) and kill it after I have generated a few graphs (which I do not manage).
The problem is to get the pid of the PicoWeb Server to kill it. Standard R functions do return the wrong one (one to low), or when the port is open, and I resort to using `ups -I` to list all Java processes, and to identify which one has been launched.
Now I am wondering - would it be possible to return in the server info the pid as well? It seems to be (please keep in mind I an NOT a programmer apart from R and definitely not Java) possible to get the pid from within the running java process (https://stackoverflow.com/a/42104000/632423
). I have no idea how this could be included, but it would be great to have this.
Another possibility (probably cleaner) would be an endpoint which stops the PicoWeb Server (e.g. localhost:8000/stopserver).