Starting Server remotely using ssh

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?

Thank you.

I’m no Unix guru either, but…

You need that ‘&’ at the end of the command which detatches the process so it has a life of its own

./servoy_server.sh &

Hope this helps,

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.

Any other ideas ?

Without having a (bigger) clue about Unix, I have had the same problem and solved it by using nohup or screen. Google for that.

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

How to setup such a startup item is described many times on this forum.
For instance in this thread: http://forum.servoy.com/viewtopic.php?t=5914

And yes, it also/still works on Leopard.

Hope this helps.

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.

Hope it helps.

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.

As someone else mentioned, using screen will solve the problem. Or what we do is to run it in a nohup session.

nohup command