Using A 0.5 Server With Screen
You finally have your brand new dedicated server, you upload the MTA server with FTP, you configure your config file and start the server.
But then, disaster strikes. When you close your SSH connection, the server drops dead.
Well, at least you have gotten this far. Congratulations. The server closes when you close your session because the server is running on your current terminal. When your session closes the terminal closes and terminates the server. There are 2 ways to work around this problem.
Starting the server in background mode
Most command line programs have a small built-in help system that allows you to see options. You can see these by using the -? swith. For MTA that would be
The output will look like:
We need to run our server in the background, so:
There we go, our server is running in the background. But what if we need to stop it? Well, we would first need to find the process ID number, after that we use the kill command to stop it:
There we go!
Now method number 2:
A remote Linux terminal supports multiple virtual screens. This is to stop the user from creating multiple sessions. This is done by the "screen" command. For more information:
We first need to start a virtual screen, therefore we type in "screen". At first glance it will look like the screen has just cleared, but it hasn't. Now you can start the server and close the terminal.
When you come back and log in again you can see that the server is still running on a different terminal:
with the command
screen -ryou can bring back your server and look at the output:
ps x. To bring up the screen use
screen -r pidwhere pid is the corresponding process ID.