Using A 0.5 Server With Screen: Difference between revisions
(Created page with 'You finally have your brand new dedicated server, you upload the MTA server with ftp, you configure your config file and start the server. Image:05-ssh-normal.jpg But then…') |
No edit summary |
||
Line 56: | Line 56: | ||
[[es:Using A 0.5 Server With Screen_ES]] | [[es:Using A 0.5 Server With Screen_ES]] | ||
[[Category:MTA 0.5]] [[Category:Historical]] |
Revision as of 15:54, 19 July 2009
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. 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 get passed this problem.
Starting the server in background mode
Most command line programs have a small build-in help system that allows you to see options. You can see these by using the -? swith. For MTA that would be
./MTAServer -?
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, up to method number 2
Using screen
A remote linux terminal supports multiple vitual screens. This to stop the user from creating multiple sessions. This is done by the "screen" command. For more information :
man screen
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 has not. 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 -r
you can bring back your server and look at the output:
If you have more then one screen running the command screen -r will bring up a list of all running screens. Every line starts with a pid (or process ID) for the running script.To know what scripts goes with what you can use
ps x
. To bring up the screen use
screen -r pid
where pid is the corresponding process ID.