I ssh to my VM with Ubuntu and ShinyProxy properly installed. When I initialise the jar file on the terminal, everything loads ok, and shinyProxy is up and running, and the apps work (till here good)
java -jar shinyproxy-2.0.0.jar
The problem is the moment I close the terminal, the ShinyProxy goes down.
I had the same result with other ShinyProxy versions.
Have you experience this problem? Any ideas how to fix this behaviour?
I’d like to have the server up and running permanently
Thank you for the help!
SOLVED (work around)
- Create a
.sh
file with the following code:
example: serverup.sh
#!/bin/bash
nohup java -jar shinyproxy-2.0.0.jar &
-
Upload the file to the sever. Either manually or with ssh
:
example:
scp ~/Desktop/serverup.sh userid@my_ip_address:serverup.sh
-
Change file permissions at the VM.
chmod +x serverup.sh
-
Execute the .sh
file at the VM
./serverup.sh
1 Like
Hello Charlie,
Another possibility is to install shinyproxy from the the .deb
file (see https://www.shinyproxy.io/downloads). This will add shinyproxy as a service that runs in the background.
Yet another option could be to run shinyproxy in a separate screen
session.
One way be to run your application as a service. Something along the line of https://medium.com/@benmorel/creating-a-linux-service-with-systemd-611b5c8b91d6
Another way is to use tmux or a related program. What it does is it creates a shell within a shell which persists even if you disconnect on purpose or due to bad connection.
tmux ls
# let's imagine it list a session with name "shinyproxy"
tmux attach -t shinyproxy
# examine that shinyproxy is running, restart it or whatever you want to do
# Press CTRL+b d
# you are now back into your original session and you can disconnect without stopping shinyproxy