Find the answer to your Linux question:
Results 1 to 10 of 10
Hi guys, this problem is not strictly linux related, but I seem to find a lot of my answers here, so I figured it was a great place to ask. ...
  1. #1
    Just Joined!
    Join Date
    Jan 2012
    Posts
    23

    screen commandline tool bugged?

    Hi guys,

    this problem is not strictly linux related, but I seem to find a lot of my answers here, so I figured it was a great place to ask. anyway:

    I have a Minecraftserver running on my server. The server is setup with the ubuntu 10.04 LTS Desktop installation.

    I am maintaining my minecraftserver by ssh'ing to the server and having the MC server run in a screen session.

    I've started the screen as such:

    Code:
    screen -S mc java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
    my problem is this:
    When i want to restart the server for various reasons, i connect to the session by typing

    Code:
    screen -r mc
    Upon gaining access i type

    Code:
    stop
    to have the MC server save and close. This also closes the screen session window.

    now my trouble is, that when i try to create the session again, all i get is the message

    Code:
    [Screen is terminating]
    I tried typing 'screen -ls' to see if the session was still running. I've tried 'killall -9 screen' to be certain. Still i only get that annoying message.

    I tried creating the screen session from another user, which worked, but only until trying to restart the session. Then same problem.

    Incidently, i sortof solved it by reinstalling screen altogether, but that is hardly the proper solution.

    If anyone would offer an idea to why this message appears and how to fix it, i'd be most appreciative

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,970
    So what changed between when it worked as expected, and then started to not work as expected?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Jan 2012
    Posts
    23
    with a clean install of screen, I can open all the sessions I want. However, when i close the session running minecraft, i cannot open or connect to any session, but only get the message [Screen is terminating] ... upon reinstalling screen, it works again until i close the minecraft session...

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,970
    Quote Originally Posted by eldamir View Post
    with a clean install of screen, I can open all the sessions I want. However, when i close the session running minecraft, i cannot open or connect to any session, but only get the message [Screen is terminating] ... upon reinstalling screen, it works again until i close the minecraft session...
    I understand that, but it seemed from your earlier post that this was not originally the case. So, again, I have to ask what changed?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Just Joined!
    Join Date
    Jan 2012
    Posts
    23
    I may have misspoken then. This was originally the case. Was like that on my first try

  6. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,970
    Ok. Thanks for the clarification. I'll have to some codgertating on this.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #7
    Just Joined!
    Join Date
    Jan 2011
    Location
    Fairfax, Virginia, USA
    Posts
    94
    Hi, I think I understand your problem. The problem is the screen parent process is terminating which will end your session.
    Try this ... try starting screen like you did before, but just do this:
    Code:
    [root@bmicek ~]# screen -S myScreen
    Okay, now in your (new) bash shell, start minecraft with your java command. To leave the screen session, detach with ^a^d (control + a control + d). Now to attach to your screen session later, use:
    Code:
    [root@bmicek ~]# screen -x myScreen
    To leave the session, enter ^a^d like before
    Last edited by BrianMicek; 01-28-2012 at 11:42 PM. Reason: typo error, sorry

  8. #8
    Linux User
    Join Date
    Jan 2005
    Location
    Saint Paul, MN
    Posts
    262
    Since you put the command on the screen command line, the screen ends when the command ends. You really wish to create a screen and then enter the screen to run the command.
    Code:
    screen -dmS mc
    screen -r mc
    java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
    control-ad
    The "control-ad" is a "control-a" followed by a "d".

  9. #9
    Just Joined!
    Join Date
    Jan 2012
    Posts
    23
    The problem is the screen parent process is terminating which will end your session.
    That makes perfect sense, actually

    Okay, now in your (new) bash shell, start minecraft with your java command. To leave the screen session, detach with ^a^d (control + a control + d). Now to attach to your screen session later, use:
    I'll try that out as soon as i get the chance and report back on my success

  10. #10
    Just Joined!
    Join Date
    Jan 2012
    Posts
    23
    Works like a dream thanks Brian and the rest of y'all

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...