Debian continiu running server (When putty shutdown)

Discussion in 'Server Operation' started by ColdDoT, Mar 14, 2006.

  1. ColdDoT

    ColdDoT Member

    Hello i've got a problem

    when i start a server prog of my server whith this command

    $./ServerProg.sh

    then it wil start a server that wil output a lot of text back to the console

    but i want tu shutdown putty and i want that the server will continu to run but when i shutdown my putty the server stops

    is there any way to change this(whith setting or other progs)

    greets kevin
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Try this:

    Code:
    ./ServerProg.sh &> /dev/null &
     
  3. ColdDoT

    ColdDoT Member

    Thx thats it :D thx a lot
    but how can i stop that prog then ?

    @off-topic
    i like to give some color to my init.d startup files like suse
    when i start a init.d script in suse you get
    Starting mysql done

    in debian you get
    Starting mysql

    is there some code for or a app
     
    Last edited: Mar 14, 2006
  4. falko

    falko Super Moderator Howtoforge Staff

    Run
    Code:
    ps aux
    and search for the process ID. Then run
    Code:
    kill -9 <process_id>
    to kill it.
     
  5. ColdDoT

    ColdDoT Member

    Ye men you rules
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Hi Kevin,

    here is another useful small program, not for running daemons but for other admin tasks that shall be continued after you closed putty.

    If you want to run a script or program, shutdown putty and continue the session later witout stopping the script, you shall have a look at the "screen" program.

    Installation on Debian / ubuntu:

    Code:
    apt-get install screen
    To start screen, run the command:

    Code:
    screen
    Now you are in a type of virtual console, start your script now. For example the "top" command:

    Code:
    top
    To close the session, press [ctrl] + a + d

    Now you are again on your "normal" putty console. It seems as top is not running.

    To connect back to your virtual screen console, run this command:

    Code:
    screen -r
    Now you see that top is still running on your server.

    Press "q" to stop the top program and then press [ctrl] + a + d to close the screen. If there is no program running in the screen virtual console, it closes completely and cannot be reopened with screen -r again.

    For more screen commands, see:

    Code:
    man screen
     

Share This Page