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.

Tutorial Automatic startscript for Starbound servers v. glad Giraffe on Linux (Up to Date)

Discussion in 'Multiplayer' started by DeNite, Jun 25, 2015.

  1. DeNite

    DeNite Master Chief

    Hi folks,

    I've created a startscript for Starbound-Servers with " v. glad giraffe".
    The guide works fine for UNIX/LINUX systems that using "systemd"

    If you have questions to this guide feel free to ask.

    This guide requires that you have already installed Steam and Starbound on your Linux machine.


    In the near future I will create a full guide for install, configurate and administrate a dedicated Starbound server on Linux

    _____________________________________________________________________________________

    • After you have installed your Starbound-Server you need to create a shellscript file in the folder where the "starbound_server" file is located. (e. g. /home/YOURUSERNAME/steam/starbound/linux64or32/)

      Important! --> Choose the correct bit version of your Linux system (Starbound folder linux64 or linux32) <--Important


    1. Commands in Terminal:
    • cd /folderwhereyourfileislocated/
    • nano launch_starbound_server.sh
    //Paste the Code below into the Terminal!


    Filename: launch_starbound_server.sh
    Code:
    #!/bin/sh
    
    cd "$(dirname "$0")"
    
    LD_LIBRARY_PATH=./ ./starbound_server

    2. Commands in Terminal:
    • chmod +x launch_starbound_server.sh
    _____________________________________________________________________________________

    • Now we create the startscript that allows us to autostart the server with boot and stop the server with shutdown.

    3. Commands in Terminal:
    • cd /etc/init.d/
    • nano starbound
    //Paste the Code below into the Terminal!
    Filename: starbound
    Code:
    #!/bin/bash
    # For Starbound Server creaters
    # chkconfig: 2345 85 85
    # description: Starbound startscript for server - beta v. spirited giraffe
    # processname: starbound
    # Created By: DeNite (community.playstarbound.com)
    
    PROG=launch_starbound_server
    STARBOUND_HOME=/folderwhereyourLAUNCH_STARBOUND_SERVER.SHfileislocated/
    DAEMON=$STARBOUND_HOME/$PROG.sh
    PIDFILE=/var/run/$PROG.pid
    
    # Source function library
    # . /etc/rc.d/init.d/functions
    
    [ -r /etc/sysconfig/launch_starbound_server ] && . /etc/sysconfig/launch_starbound_server
    
    RETVAL=0
    
    case "$1" in
       start)
    #   echo -n $"Starting $PROG: "
       cd $STARBOUND_HOME
      start-stop-daemon --start -c nobody --pidfile $PIDFILE
       $DAEMON >/dev/null 2>/dev/null &
       RETVAL=$?
       if [ $RETVAL -eq 0 ]; then
         echo $! > $PIDFILE
    #     touch /var/lock/subsys/$PROG
       fi
    #   [ $RETVAL -eq 0 ] && success $"$PROG startup" || failure $"$PROG startup"
       echo
       ;;
       stop)
      start-stop-daemon --stop --quiet --pidfile $PIDFILE \
      --name java
      rm -f $PIDFILE
       echo
       [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$PROG
       ;;
       restart)
       $0 stop
       $0 start
       ;;
       status)
       status $PROG -p $PIDFILE
       RETVAL=$?
       ;;
       *)
       echo $"Usage: $0 {start|stop|restart|status}"
       RETVAL=1
    esac
    
    exit $RETVAL
    

    3. Commands in Terminal:
    • chmod +x starbound
    • systemctl enable starbound
    • update-rc.d starbound defaults
    • systemctl daemon-reload
    • systemctl enable starbound --> --// For safety second time enable
    • systemctl start starbound
    _____________________________________________________________________________________


    • Thats the complete way of configurate the autostartscript!


    Feel free to ask if you have problems or questions to this guide!



    most humble
    your DeNite
     
    Last edited: Dec 9, 2015
  2. DeNite

    DeNite Master Chief

    Push

    the startscript is up to date!
     

Share This Page