Linux, Bukkit started on another terminal session, how to get to it?

Discussion in 'Bukkit Help' started by hpdvs2, Apr 5, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    hpdvs2

    I'm using linux, and I remoted into my server, and started the bukkit server from a terminal.
    But now, I don't have access to that machine I connected from.

    From the server, how can I tap into the bukkit console from another terminal? is it possible?

    And if not (or is), are there any recommendations for executing this in a way I can start the server as a service or something, and then be able to see the console and send commands to it?

    Thanks.
     
  2. Offline

    JWhy

    Do you start it with screen?
    Also, if you have multiple users (for the terminals), you should use su to access its screen
     
  3. Offline

    hpdvs2

    I did not even know about screen until you brought it up here. VERY Useful!

    (Adding clarification so other Newbs like myself can resolve this issue easily.)

    It wasn't on my system, so I used (in CentOS)
    Code:
    yum install screen
    to get it.
    Then
    Code:
    screen
    , followed by my starting command.
    Ctrl+a Ctrl+d gets me out of it, then from any other console as that user, I type
    Code:
    screen -r
    to get in to it again.

    thanks.

    also posting this, for extra reference on "screen"

    http://www.cyberciti.biz/tips/linux-screen-command-howto.html

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 25, 2016
    JWhy likes this.
  4. Offline

    JWhy

    Yep, nice to got another screen-fan :D
    However, if you've entered
    Code:
    screen <somecommand>
    you can press ctrl+a and then 'D' to 'minimize' the screen. Then you'll have the normal console. To 'reopen' that screened command you can type 'screen -r'. Have fun with that ;)
     
  5. Offline

    LHammonds

    I run an Ubuntu server and also use screen since I have CraftBukkit startup from crontab. I also have a plugin called AutoShutdown that shuts down CraftBukkit cleanly and allows me to reboot the server...which then creates a backup and starts the server up (via crontab)

    Here is my crontab file (root user)
    Code:
    0 3,15 * * * /opt/craftbukkit/startcb.sh
    57 2,14 * * * /sbin/shutdown -r now
    Here is the contents of startcb.sh:
    Code:
    #!/bin/sh
    CBDIR="/opt/craftbukkit"
    cd ${CBDIR}
    ${CBDIR}/backupcb.sh
    screen -d -m java -d64 -Xincgc -Xmx5120M -jar ${CBDIR}/craftbukkit.jar nogui
    
    And here is the backupcb.sh
    Code:
    TEMPDIR="/tmp"
    CBDIR="/opt/craftbukkit"
    SHAREDIR="/srv/samba/share"
    ARCHIVEFILE="`date +%-%m-%d-%H-%M`_craftbukkit-backup.tar.7z"
    tar -cpf - ${CBDIR} | 7za a -si -mx=9 -w${TEMPDIR} ${TEMPDIR}/${ARCHIVEFILE} 1>/dev/null 2>&1
    mv ${TEMPDIR}/${ARCHIVEFILE} ${SHAREDIR}/.
    
    And here is the plugins\AutoShutdown\config.yml:
    Code:
    kickreason: Scheduled shutdown.
    warntimes: 60,45,30,15,10,5,4,3,2,1
    gracetime: 30,15
    kickonshutdown: true
    shutdowntimes: 02:55,14:55
    
    EDIT: FYI - I plan to change this so that the startup script is called every 15 minutes. The script will check to see if CraftBukkit is already running, if so, it will simply exit...but if it finds it not running, it will kick it off. This will allow the server to recover from a crash that shuts down CraftBukkit (have not seen this happen yet) or if I forget to start it back up after making some changes (most likely event).
     
    JWhy likes this.
Thread Status:
Not open for further replies.

Share This Page