1. When making a thread, please tag your thread accordingly using the menu to the left of the textfield where you name your thread where applicable. Server Advertisements and Mod Releases should be contained to their respective subforums.

Server Discussion Setting up an Ubuntu 12.04 server

Discussion in 'Multiplayer' started by DeMossiah, Dec 5, 2013.

  1. Joshadow

    Joshadow Void-Bound Voyager

    Alright, have a 2GB VPS server set up now. It got further but it still seems to shut down at the end:

    Code:
    ...
    Info: Done loading Star::Root.
    Info: Server version 'Beta v. Irritated Koala' '616' '418'
    Info: Scanning for router for portforwarding
    Info: Done scanning for router for portforwarding
    Info: Creating universe storage directory
    Info: Writing Star::Configuration to './starbound.config'
    Info: Creating world alpha:55772385:-69838902:-11740186:9 
    Info: Spawn surface at (0, 1651.5)
    Info: Generating 1 dungeons
    Info: Generating a dungeon
    Info: Placing dungeon at (6157, 1641)
    Warn: Failed to place dungeon object: woodenbed2 direction: 1 position: (6522, 1488)
    Warn: Failed to place dungeon object: woodenchair direction: 1 position: (6478, 1499)
    Warn: Failed to place dungeon object: woodenbed2 direction: 1 position: (6481, 1509)
    Warn: Failed to place dungeon object: woodenbed2 direction: 1 position: (6531, 1509)
    Warn: Failed to place dungeon object: fluorescentlight direction: 0 position: (6314, 1513)
    Warn: Failed to place dungeon object: fluorescentlight direction: 0 position: (6332, 1513)
    Warn: Failed to place dungeon object: fluorescentlight direction: 0 position: (6408, 1513)
    Warn: Failed to place dungeon object: fluorescentlight direction: 0 position: (6426, 1513)
    Warn: Failed to place dungeon object: bunkerpanel2 direction: 0 position: (6343, 1543)
    Warn: Failed to place dungeon object: bunkerserver direction: 0 position: (6287, 1570)
    Warn: Failed to place dungeon object: bunkerlightv direction: 0 position: (6300, 1573)
    Warn: Perf: DungeonDefinition::buildDungeon millis: 1914
    Warn: Perf: DungeonGenerator::generate millis: 2010
    Warn: Object floweryellow does not have a price set
    Warn: Perf: UniverseServer::createWorld millis: 5770
    Warn: Perf: WorldServer::update millis: 176
    Warn: Perf: WorldServerThread::update.worldUpdate millis: 194
    Warn: Perf: WorldServerThread::update millis: 194
    Warn: Perf: WorldServerThread::sync millis: 1022
    Warn: Perf: UniverseServer::doTriggeredStorage millis: 1022
    Warn: Perf: UniverseServer::run.innerloop millis: 1122
    Info: Shutting down world alpha:55772385:-69838902:-11740186:9
    And it seems to just be stuck there
     
  2. InterSlayer

    InterSlayer Void-Bound Voyager

    I think if no one is on, the server automatically shuts down until someone connects.

    You can use the top command to verify if the server is running.

    If you can't connect, make sure your firewall has port 21025 open.
     
  3. Joshadow

    Joshadow Void-Bound Voyager

    Ah hey, it was indeed running, and I was able to connect to it :) After a few minutes of play it's only up to about 289.12 MB ram used, woot.


    ---
    Edit 1:

    Hmm, well that was using the manual command (su - steam -c "/home/steam/Steam/SteamApps/common/Starbound/linux64/launch_starbound_server.sh") - that works fine...

    However I'm still having problems when trying to use the service:
    - I still get the previous "* Starbound Server Daemon 'starbound' is not running." when I start (wait some time) and then try to stop the service.
    - no starbound_serve appears in the processlist (as it does when running the command manually)
    - no server log is created so it definitely doesn't even get to running the server

    I have the starbound file at /etc/init.d/starbound and it has the correct permissions.


    ---
    Edit 2:

    I used helio's suggestion and gave supervisor a try. It works great! even after completely rebooting my Ubuntu server :D

    I'll have to keep it in mind for future servers, this makes things much easier.
     
    Last edited: Dec 8, 2013
  4. 8bitmasochism

    8bitmasochism Space Hobo

    Utilizing the supervisor method is there a way to check/install updates as they're released as well?
     
  5. helio

    helio Orbital Explorer

    You know, I'm not quite sure, but you got me brainstorming and what do you guys think of this. We could make our Starbound directory containing the assets and linux64 folder a git or hg repository and use a .hgignore / .gitignore to tell it to ignore everything except the assets and the server. Then, as updates come out, we push the changes to our repo and pull them to our server. At the same time we've now got the servers under version control, so if a new version comes out that isn't working or we don't like it, we can just roll it back? Although, I'm not sure if there'd be an issue with new / updated clients not being able to connect to older version of the server.

    Bitbucket enforces no repo size limits: https://confluence.atlassian.com/pages/viewpage.action?pageId=273877699. However, this is clearly the _wrong_ way to do it, so I hope people have better solutions out there!
     
  6. 8bitmasochism

    8bitmasochism Space Hobo

    I'm afraid I'm not experienced at all so forgive me if I'm incorrect.

    That being said, could you elaborate further on why this wouldn't be plausible solution? I'd like to contribute and if that means nothing more than finding better solutions then so be it!
     
  7. toljin

    toljin Space Hobo

    I am having a problem with setting up the server.. when I do

    Code:
    su - steam -c "/home/steam/Steam/SteamApps/common/Starbound/linux64/launch_starbound_server.sh"
    I get "command not found: su"?
     
  8. Dtho_47

    Dtho_47 Star Wrangler

    Use "sudo"

    sudo su - steam -c "...
    Or:
    Or
     
  9. toljin

    toljin Space Hobo

    neither of those work still got command not found for both. im using putty for this, is that a problem? Im in the Steam> command line
     
  10. Bradlfett

    Bradlfett Orbital Explorer

    To start the server you must quit out of the steam command line first
     
  11. toljin

    toljin Space Hobo

    Thank you very much! But how do you quit out by using exit, end or crtl c ?
     
  12. Clinton

    Clinton Zero Gravity Genie

    Just use the command: quit
     
  13. Ceetee

    Ceetee Void-Bound Voyager

    im able to get the server working just fine through manually starting it, however, I cant seem to get init.d working.

    When I try to start it, it says
    Code:
    ERROR: Process ID list syntax error.
    and when I try to do the update-rc.d code it tells me
    Code:
    update-rc.d: warning: /etc/init.d/starbound missing LSB keyword 'required stop'
    
    update-rc.d: warning: starbound stop runlevel arguments (0 1 6) do not match LSB Default-Stop values (S 0 1 6)
    system start/stop links for /etc/init.d/starbound already exist.
     
  14. Dtho_47

    Dtho_47 Star Wrangler

    start | stop - works
    update - does not work.
     
  15. Dtho_47

    Dtho_47 Star Wrangler

    Why all this instruction comes from the root?
    sudo everywhere necessary.
     
  16. GennyP

    GennyP Tentacle Wrangler


    I don't quite understand what you did to make your problem work out but I'm having the same problem. Following your post chain is kind of difficult so I'd appreciate any help.
     
  17. InterSlayer

    InterSlayer Void-Bound Voyager

    Switched to using Upstart to run the server at boot or if it crashes.

    Script was from here. Just remember to change the username (User is steam instead of starbound if you used this guide, and to change the server folder location)
     
  18. loudambiance

    loudambiance Space Spelunker

    I could not get your init.d script to work in Ubuntu as is. I had to add the LD_LIBRARY_PATH statements to it to get it to work. I also added (and modified to tar/gzip) a backup that I found in another init.d

    Code:
    #! /bin/sh
    ### BEGIN INIT INFO
    # Provides:        starbound
    # Required-Start:    networking
    # Default-Start:    2 3 4 5
    # Default-Stop:        S 0 1 6
    # Short-Description:    Starbound Server Daemon
    # Description:        Starts/Stops/Restarts the Starbound Server Daemon
    ### END INIT INFO
    
    PATH=/sbin:/usr/sbin:/bin:/usr/bin
    DESC="Starbound Server Daemon"
    NAME=starbound
    STEAM=/opt/steam
    DIR=$STEAM/starbound/linux64
    DAEMON=$DIR/starbound_server
    SBPATH=$DIR
    BACKUPPATH=$STEAM/starbound/backup
    PIDFILE=/var/run/$NAME.pid
    SCRIPTNAME=/etc/init.d/$NAME
    
    USER=steam
    GROUP=steam
    DAEMON_ARGS=""
    
    STEAM_DIR=/opt/steam
    STEAM_DAEMON=$STEAM_DIR/steamcmd.sh
    
    STEAM_USER=user
    STEAM_PASS=pass
    STEAM_APP=211820
    
    [ -x "$DAEMON" ] || exit 0
    
    . /lib/init/vars.sh
    . /lib/lsb/init-functions
    
    do_start() {
        if [ -e $PIDFILE ]; then
            PID=`cat $PIDFILE`
    
            if ( ps -p $PID > /dev/null ); then
                log_failure_msg "$DESC '$NAME' is already running."
                return 1
            else
                rm -f $PIDFILE
                LD_LIBRARY_PATH=./ start-stop-daemon --start --background --chdir $DIR --chuid $USER:$GROUP --make-pidfile --pidfile $PIDFILE --quiet --exec $DAEMON --test > /dev/null || return 1
                LD_LIBRARY_PATH=./ start-stop-daemon --start --background --chdir $DIR --chuid $USER:$GROUP --make-pidfile --pidfile $PIDFILE --quiet --exec $DAEMON -- $DAEMON_ARGS || return 2
            fi
        else
            LD_LIBRARY_PATH=./ start-stop-daemon --start --background --chdir $DIR --chuid $USER:$GROUP --make-pidfile --pidfile $PIDFILE --quiet --exec $DAEMON --test > /dev/null || return 1
            LD_LIBRARY_PATH=./ start-stop-daemon --start --background --chdir $DIR --chuid $USER:$GROUP --make-pidfile --pidfile $PIDFILE --quiet --exec $DAEMON -- $DAEMON_ARGS || return 2
        fi
    }
    
    do_stop() {
        if [ -e $PIDFILE ]; then
            PID=`cat $PIDFILE`
    
            if ( ps -p $PID > /dev/null ); then
                start-stop-daemon --stop --signal 2 --quiet --pidfile $PIDFILE
                [ "$?" = 2 ] && return 2
            else
                log_failure_msg "$DESC '$NAME' is not running."
                rm -f $PIDFILE
                return 1
            fi
        else
            log_failure_msg "$DESC '$NAME' is not running."
            return 1
        fi
    }
    
    case "$1" in
        start)
            log_daemon_msg "Starting $DESC..." "$NAME"
            do_start
    
            case "$?" in
                0|1) log_end_msg 0 ;;
                1) log_end_msg 1 ;;
            esac
        ;;
        stop)
            log_daemon_msg "Stopping $DESC..." "$NAME"
            do_stop
    
            case "$?" in
                0|1) log_end_msg 0 ;;
                2) log_end_msg 1 ;;
            esac
        ;;
        backup)
                    echo "Backing up Starbound universe"
      if [ -d $BACKUPPATH/universe_`date "+%m.%d.%Y"` ]
      then
        for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
        do
          if [ -d $BACKUPPATH/universe_`date "+%m.%d.%Y"`-$i ]
          then
            continue
          else
            su -l $USER -c "cd $SBPATH && cp -r universe $BACKUPPATH/universe_`date "+%m.%d.%Y"`-$i"
            su -l $USER -c "cd $BACKUPPATH && tar -cjf universe_`date "+%m.%d.%Y"`-$i.tar.gz universe_`date "+%m.%d.%Y"`-$i"
            su -l $USER -c "cd $BACKUPPATH && rm -rf universe_`date "+%m.%d.%Y"`-$i/"
            break
          fi
        done
      else
        su -l $USER -c "cd $SBPATH && cp -r universe $BACKUPPATH/universe_`date "+%m.%d.%Y"`"
        su -l $USER -c "cd $BACKUPPATH && tar -cjf universe_`date "+%m.%d.%Y"`.tar.gz universe_`date "+%m.%d.%Y"`"
        su -l $USER -c "cd $BACKUPPATH && rm -rf universe_`date "+%m.%d.%Y"`/"
        echo "Backed up universe"
      fi
        echo "Backup complete"
        ;;
        restart)
            log_daemon_msg "Restarting $DESC..." "$NAME"
            do_stop
    
            case "$?" in
                0|1)
                    do_start
    
                    case "$?" in
                        0) log_end_msg 0 ;;
                        *) log_end_msg 1 ;;
                    esac
                ;;
                *)
                    log_end_msg 1
                ;;
            esac
        ;;
        status)
            if [ -e $PIDFILE ]; then
                PID=`cat $PIDFILE`
    
                if ( ps -p $PID > /dev/null ); then
                    log_success_msg "$DESC '$NAME' is running (pid $PID)."
                    exit 0
                else
                    log_failure_msg "$DESC '$NAME' is not running."
                    rm -f $PIDFILE
                    exit 1
                fi
            else
                log_failure_msg "$DESC '$NAME' is not running."
                exit 1
            fi
        ;;
        update)
            su - $USER -c "$STEAM_DAEMON +login $STEAM_USER $STEAM_PASS +app_update $STEAM_APP +quit"
            ;;
        validate)
            su - $USER -c "$STEAM_DAEMON +login $STEAM_USER $STEAM_PASS +app_update $STEAM_APP validate +quit"
            ;;
        *)
            log_action_msg "Usage: $SCRIPTNAME {start|stop|restart|status|update|validate|backup}"
            exit 0
        ;;
    esac
    
    
    I use the following cronjob in conjunction with the backup call to make a daily backup:
    Code:
    0 5 * * * service starbound backup
    
    You could schedule yours to back up more or less frequently.

    Edit:
    Additions:
    I created a shell script to keep the server up and running. I have mine running as root because my steam user does not have rights to start and stop services.

    I named the shell script: viagra.sh and placed it in /root/viagra.sh
    Code:
    #!/bin/sh
    service starbound status
    
    SB_RET=$?
    
    if [ $SB_RET -eq 1 ];
    then
            service starbound start
    fi
    
    and that is run by cron via:
    Code:
    5 * * * * /root/viagra.sh
    
     
    Last edited: Dec 18, 2013
  19. cpm

    cpm Aquatic Astronaut

    Hi all,
    I have a VPS running on CentOS, and I'm having trouble downloading Starbound using SteamCMD
    After login and SET UP install dir (force_install_dir ./sb), I enter "app_update 211820", then this prints around 60 times:

    "App state (0x10102) reconfiguring, progress: 0.00 (0 / 0)"

    Then, the following errors:

    "Error! App '211820' state is 0x1 after update job."

    How should I do? Please help.
     
  20. metapaps

    metapaps Intergalactic Tourist

    I've had this issue on CentOS 6(64,32) CentOS 5(32) and Debian 5 so far. Not sure where I'm going wrong. Figured it might be that steamcmd has issues with centos because libgcc, so I made the switch to debian. The problem seems to be finicky.
    Sadface until I find a fix. You are not alone.

    Edit, just happened again..

    Steam>app_update 211820
    Initial App state (0x2) update required
    App state (0x10102) reconfiguring, progress: 0.00 (0 / 0)
    App state (0x20102) validating, progress: 14.95 (464297545 / 3105221975)
    App state (0x80102) preallocating, progress: 1.14 (35510590 / 3105221975)
    App state (0x80102) preallocating, progress: 1.65 (51361723 / 3105221975)
    App state (0x80102) preallocating, progress: 14.89 (462265385 / 3105221975)
    App state (0x80102) preallocating, progress: 15.37 (477306666 / 3105221975)
    App state (0X300502) downloading, progress: 0.00 (10925 / 3105221975)
    App state (0X300502) downloading, progress: 0.00 (14918 / 3105221975)
    App state (0X300502) downloading, progress: 0.01 (341486 / 3105221975)
    App state (0X300502) downloading, progress: 0.01 (341486 / 3105221975)
    App state (0X300502) downloading, progress: 0.01 (372386 / 3105221975)
    App state (0X300502) downloading, progress: 0.01 (434400 / 3105221975)
    App state (0X300502) downloading, progress: 0.03 (904980 / 3105221975)
    App state (0X300502) downloading, progress: 0.06 (1982270 / 3105221975)
    App state (0X300502) downloading, progress: 0.08 (2470369 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796058 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    App state (0X300502) downloading, progress: 0.09 (2796252 / 3105221975)
    Error! App '211820' state is 0x402 after update job.


    Edit #2: Switched to ubuntu 32, it worked the first time- perfectly. <3
     
    Last edited: Dec 13, 2013

Share This Page