Resolved How can I close Terminal, but keep Java program running in remote Unix shell?

Discussion in 'Mac Programming' started by tevion5, Jan 3, 2015.

  1. tevion5, Jan 3, 2015
    Last edited: Jan 3, 2015

    tevion5 macrumors 68000

    tevion5

    Joined:
    Jul 12, 2011
    Location:
    Ireland
    #1
    Okay so this is probably a super straight forward issue, but I can not find a clear answer online after a good bit of searching.

    Basically, I am trying to set up my MineCraft server to run off a remote linux system on my college campus. I can upload the game server files, connect with ssh and start it up no problem. I can connect from any client and it all runs surprisingly well.

    But here's the problem.

    The moment I exit the SSH session by closing the Terminal.app on my mac, the server stops. How can I keep the server operating after I close the session on my Mac? I tried using things like 'nohup' and such, but because I am stuck in a Java/Minecraft sort of session, it only excepts minecraft related commands.

    How do I go back a level in the command line so that I can close my SSH session and keep my server running?
     
  2. tevion5 thread starter macrumors 68000

    tevion5

    Joined:
    Jul 12, 2011
    Location:
    Ireland
    #2
    Never mind, I figured out how to use 'Screen'! Amazing stuff. :D
     
  3. b0fh666 macrumors 6502a

    b0fh666

    Joined:
    Oct 12, 2012
    Location:
    south
  4. displaced macrumors 65816

    displaced

    Joined:
    Jun 23, 2003
    Location:
    Gravesend, United Kingdom
    #4
  5. blaster_boy macrumors 6502

    blaster_boy

    Joined:
    Jan 31, 2004
    Location:
    Belgium
    #5
    just use an ampersand at the end of your command

    You could also launch the program as a forked process in a subshell.

    Just add an ampersand (&) after your server command. The process is launched and control is returned to you.

    More info : http://hacktux.com/bash/ampersand
     
  6. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #6
    At the point of backgrounding a job, a nohup, and redirection of stdin, stderr, and stdout would also be prudent.

    -Lee
     

Share This Page