I am no Unix guru so forgive me if this is a stupid question but my client is running Servoy Server on Mac OS X and he’d like to be able to start the server remotely using ssh. But when he closes the remote shell, the server shuts down.
Is there a way to start the server using a remote shell and have it stay up when he closes the shell? If not, how can he start the server remotely, short of using a VNC?
My customer tried it by ssh into the server and on a terminal session directly on the server and in both case closing the terminal app caused the Servoy server to quit.
Another option would be to use the SystemStarter process.
In essence you setup a startup item that will be triggered on boot.
But as added benefit you can start/stop this process also from the CLI without loosing your process again when you logoff.
Syntax: sudo SystemStarter start yourStartupItemName
My server lives on a linux machine.
I launch the server all the time from an ssh. Swingman is correct. If you add a ‘&’ to the end of your command it will run independent.
Another thing to make sure of is that you have permission to run the script. I have to log in as root in order to launch the server.
Actually amcgilly is correct, ‘&’ backgrounds a process and when the session is closed, the job which is a child of the current open shell dies. As mentioned something like ‘nohup servoy_server.sh &’ should also work but I have run into problems with nohup on OS X so YMMV. (nohup == "No hang-up)
On OS X creating a StartupItem is the proper way to keep some server type process running. For linux the best bet is to setup an init script so that servoy always starts at boot-up.
Barring any of that, using screen would be suitable in a pinch for linux or OS X. Something like ‘$screen -A -m -d -S servoy-server ./servoy_server.sh’
elyod_72:
I have to log in as root in order to launch the server.
you should change the owner of the servoy files to a dedicated servoy user and launch it that way. root is not required as all ports servoy uses are > 1024 and running servers as root is asking for trouble.