Announcement

Collapse
No announcement yet.

DDUT4: Linux Server Administration & Deployment Suite

Collapse
This is a sticky topic.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    Originally posted by clopezi View Post
    It's very weird because it's a clean installation.

    I'm using Ubuntu 14.04, bash are 4.3.11 and wget is properly installed and working outside the script.

    Thank for your help!
    Looks like this could use some live debugging. If you can, please send me SSH credentials over PM and I'll log in when I find the time. I probably won't need root access, just a user with the scripts deployed and with "strace" installed (and even that is optional).


    Otherwise we'd have to schedule a session and I'm not sure we could find a comfortable time for both of us.
    Snir "DDRRE" Hassidim - Living and breathing UT since 2002!
    "When Video Games and the Enterprise Meet" - Read my chronicles of building a gamers club at my workplace.
    Facebook | LinkedIn

    Comment


      #32
      Originally posted by DDRRE View Post
      Looks like this could use some live debugging. If you can, please send me SSH credentials over PM and I'll log in when I find the time. I probably won't need root access, just a user with the scripts deployed and with "strace" installed (and even that is optional).


      Otherwise we'd have to schedule a session and I'm not sure we could find a comfortable time for both of us.
      Of course, no problem, i have sended you the credentials, and strace is installed

      Thank you!

      Comment


        #33
        Originally posted by clopezi View Post
        Of course, no problem, i have sended you the credentials, and strace is installed

        Thank you!
        Looking at your command history, you used "sh <file>" to launch the script. That forced the interpreter to be /bin/sh, which didn't recognize the bash scripting language macros in my tools, causing all kinds of logic failures, including failure to detect "wget". And even if it went past that point, it would've most likely malfunctioned somewhere else.

        The proper way to execute non-PATH files on UNIX-like systems is by specifying the executable, path included. If the executable is in the current directory, just use "./", example:

        ./updateServer.sh
        Last edited by DDRRE; 03-25-2016, 04:21 PM.
        Snir "DDRRE" Hassidim - Living and breathing UT since 2002!
        "When Video Games and the Enterprise Meet" - Read my chronicles of building a gamers club at my workplace.
        Facebook | LinkedIn

        Comment


          #34
          Originally posted by DDRRE View Post
          Looking at your command history, you used "sh <file>" to launch the script. That forced the interpreter to be /bin/sh, which didn't recognize the bash scripting language macros in my tools, causing all kinds of logic failures, including failure to detect "wget". And even if it went past that point, it would've most likely malfunctioned somewhere else.

          The proper way to execute non-PATH files on UNIX-like systems is by specifying the executable, path included. If the executable is in the current directory, just use "./", example:

          ./updateServer.sh
          Wow, i feel now like a total noob, thank you very much for your help, and sorry because it was my fault.

          I now installed everything, but i have a crash on launch. The server start running, bind the port and suddenly:

          LogModuleManager:Warning: No filename provided for module DerivedDataCache
          LogModuleManager:Warning: ModuleManager: Unable to load module 'DerivedDataCache' because the file '/home/<username>/ut4-DM/Engine/Binaries/Linux/' was not found.

          I checked that the path "/home/<username>/ut4-DM/Engine/Binaries/Linux/" is right, exists, etc. So i tried to reinstall everything, but same mistake.

          Thank you!

          Comment


            #35
            Originally posted by clopezi View Post
            Wow, i feel now like a total noob, thank you very much for your help, and sorry because it was my fault.

            I now installed everything, but i have a crash on launch. The server start running, bind the port and suddenly:

            LogModuleManager:Warning: No filename provided for module DerivedDataCache
            LogModuleManager:Warning: ModuleManager: Unable to load module 'DerivedDataCache' because the file '/home/<username>/ut4-DM/Engine/Binaries/Linux/' was not found.

            I checked that the path "/home/<username>/ut4-DM/Engine/Binaries/Linux/" is right, exists, etc. So i tried to reinstall everything, but same mistake.

            Thank you!
            This looks like something for the devs, try asking on a dedicated thread.
            Snir "DDRRE" Hassidim - Living and breathing UT since 2002!
            "When Video Games and the Enterprise Meet" - Read my chronicles of building a gamers club at my workplace.
            Facebook | LinkedIn

            Comment


              #36
              Hi DDRRE and all others,

              been an oldtime instagib player in the past i've written some scripts to manage my servers, check if they are still running and restart when needed. I've been checking if the start/stop script was still working and it is. Perhaps you can use it to integrate in your tool to get the restart and backgrounding working and perhaps a health check.

              If you run check or status or check it will check your server and start it when not running (you can setup cronjobs for this).
              running with debug will output on screen
              rest will background the process.

              Attached the script and the readme from back then. Mind its old, but still working. If you adjust the basedir on the script you should be ready to go already.

              If you got any questions, my mail is in the readme, IRC channel ain't active anymore


              README
              Code:
              Installing UT2k4ss for Linux dedicated server
              ===========================================
              
              
              Last update      : 21-09-2007
              Version          : 0.3
              Email contact    : SkuLLy <info@dominating.nl>
              
              
              Tested on:
              Debian
              CentOS
              
              
              Comment and suggestions are more then welcome.
              
              
              Usage of this script is at own risk.
              
              
              ------
              1 Information
              2 Requirements
              3.1 Basic installation
              3.2 Installation in init.d (start on serverboot)
              3.3 Installation status check in cron
              4 Usage
              5 Todo
              ------
              
              
              # 1 Information
              ---------------
              UT2k4ss is a start and stop script written for use on different linux
              distributions so its not using any tools like start-stop-daemon.
              It is also possible to run it as a non-root user because of that and this is
              highly recommended!
              
              
              # 2 Requirements
              -------------------
              - a Linux distribution
              - some programs needs to be installed like awk, ps and grep.
                but these are pretty common tools and most of the time
                already installed.
              - When using screen you need to install it
              	On debian: apt-get install screen
              	On CentOS: yum install screen
              
              
              # 3.1 Basic installation
              -------------------------
              Installating the script is pretty easy. You already managed to download
              and unpack this little package so we are already halfway there.
              You dont need to be root to use this.
              
              
              1. copy the UT2k4ss script to the desired location
              2. if needed you can change the owner/group of the file
              3. edit the file to your needs where its needed
              ! DO NOT EDIT THIS FILE WITH A DOS EDITOR !
              4. make the file executable (pick one or create your own)
               - chmod +x ut2k4ss (the easy way)
               - chmod 700 ut2k4ss (the better way)
               - chmod 750 ut2k4ss (if a group also needs rights on the file)
              5. start the script with:
               - ./ut2k4ss start (if you are in the same dir)
               - /path/to/file/ut2k4ss start (if you are not in the same dir)
              
              
              Note: You can not run more than one in the same dir.
              
              
              # 3.2 Installation in init.d (start on server boot)
              ---------------------------------------------------
              Some of you might want to be sure the dedicated server starts
              running when your server reboots. This can be done with the normal
              init.d way.
              
              
              1. place your ut2k4ss script in /etc/init.d
              2. go to /etc/rc3.d (or the location where rc3.d is located)
               - I assume we want to run the server when runlevel 3 is done.
              3. make a link for the dedicated server to start
               - ln -s /etc/init.d/ut2k4ss ./S99ut2k4ss
               or when rc3.d is in /etc you can use
               - ln -s ../init.d/ut2k4ss ./S99ut2k4ss
              Note: you can rename the file in init.d to be able to start multiple servers
              
              
              !! Its better to setup a cron with the status option and make it start by cron as a different user. !!
              
              
              # 3.3 Installation status check in cron
              ---------------------------------------------------
              
              
              Cron can be used to check if the server is still running. If the server aint running
              it will start it up again.
              
              
              1. Open the cron you want to use e.g. /etc/crontab
              2. add the following line
              */10 * * * * user [ -x /your/path/to/ut2k4ss ] && /your/path/to/ut2k4ss status 1>>/var/log/ut2k4_status.log 2>&1
              3. Make sure the file you are using /var/log/ut2k4_status.log exists and is writeable by the user you are using.
              
              
              This will check the babo server every 10 minutes and restart it if needed. The user can be replaced
              with the user you want to use to run the server. Make sure if you are not running as root that you will
              need to create the /var/log/babo_status.log and change owner of the file.
              
              
              Adjustments can be done according to your own wishes off course.
              
              
              # 4 Usage
              --------------------
              There are 6 options when executing the script.
               - start, this starts the server in background
               - stop, this stops the running server
               - restart, this restarts the running server
               - check, this checks if the server is running and gives online or offline back
               - status, this checks if the server is running and if not restart the server
               - debug, this starts the server but wont background the process. All server output
                 will be showed on screen. To stop hit CTRL+C (this kills the running server!)

              SCRIPT

              Code:
              #!/bin/bash
              #
              # Script Version: 0.3
              #
              # !! WARNING !!
              # I am not responsible for damage caused by misconfigurations
              # to your installation or any other damage that may occure.
              #
              # Info:
              # This script is made by SkuLLy <info@dominating.nl>
              #
              # Support:
              # sign up on the dominating.nl forums
              # http://www.dominating.nl/forum
              #
              # Read the INSTALL file for more info about this script and ways
              # to install it in crontab.
              #
              # Script is universal for different linux distro's
              # this is done on purpose to make it easy to use
              # and portable. We are NOT using start/stop daemon
              # tools written for each distro e.g. start-stop-daemon
              # on Debian.
              #
              # Vars
              # basedir = game install directory without trailing slash!
              # gamebin = name of the server executable
              # gameopt = commandline options
              # gamepid = process id file. Dont change it when not needed.
              # gamelog = name and path of the logfile
              #
              # !! ONLY USE THIS WHEN YOU KNOW WHAT YOU ARE DOING !!
              # s_enable = make use of screen when 1
              # s_name = screen session name.
              #
              # Use different names for each session for easy use.
              #
              # Tested on:
              # Debian
              # CentOS 4.4
              # Ubuntu
              #
              ###################################################
              #
              #Config these setting according to your setup.
              basedir="/home/dedicated/ut4"
              gamename="Ut2k4"
              gamebin="LinuxServer/Engine/Binaries/Linux/UE4Server-Linux-Shipping"
              gamepid="${basedir}/ut2k4.pid"
              gamelog="ut2k4.log"
              gameopt="UnrealTournament DM-DeckTest?Game=DM?MaxPlayers=10?mutator=Instagib"
              #
              
              
              #Screen config
              #
              #ONLY USE SCREEN IF YOU KNOW HOW IT WORKS AND WANT IT.
              #MAKE SURE SCREEN IS INSTALLED!!
              s_enable=0
              s_name="ut2k4_1"
              ##################################################
              # NO CHANGES BELOW. ELSE ITS ON YOUR OWN RISK
              #
              #Checking the stuff
              if [ ${s_enable} == 1 ] ; then
              	screen=`which screen`
              fi
              if [ -f "${basedir}/${gamebin}" ]; then
              	if [ ! -x "${basedir}/${gamebin}" ]; then
              		echo -e "${gamebin} file is not executable"
              		echo -e "Please fix this and try again"
              		exit 2
              	fi
              else
              	echo "cannot find ${gamebin}!"
              	echo "If this is not correct edit the start script"
              	exit 2
              fi
              
              
              case "$1" in
              	start)
              	echo -n "Starting $gamename dedicated server: "
              	cd ${basedir}/LinuxServer/Engine/Binaries/Linux/
              	if ps -ef |grep ${basedir}/${gamebin}|awk -F" " -v game=${basedir}/${gamebin} 'BEGIN {status=1} ; $8 == game {status=0} ; END {exit status}' ; then
              		echo -e "already active"
              		exit 3
              	else
              		if [ ${s_enable} == 1 ] ; then
              			cd ${basedir}
              			cp ${gamelog} ${gamelog}.crash
              			cd ${basedir}/LinuxServer/Engine/Binaries/Linux/
              			${screen} -d -m -L -S ${s_name} $0 debug
              		else
              			cd ${basedir}
              			cp ${gamelog} ${gamelog}.crash
              			cd ${basedir}/LinuxServer/Engine/Binaries/Linux/
              			if ${basedir}/${gamebin} ${gameopt} >> ${basedir}/${gamelog} & sleep 1 ; then
              				pid=`ps -ef |grep ${basedir}/${gamebin}|awk -F" " -v game=${basedir}/${gamebin} 'BEGIN {status=1} ; $8 == game { print $2 } ; END {exit status}'`
              			  echo ${pid} > ${gamepid}
              				if [ -f "${gamepid}" ] && ps h `cat "${gamepid}"` >/dev/null; then
                       		echo -e "....Started!"
              					exit 0
                    		else
                    		   echo -e "....Failed to start. Check logfile or run in debug!"
                    		   exit 1
                    		fi
              			else
              				echo -e "Failed"
              			fi
              		fi
              	fi
              	;;
              	stop)
              	echo -n "Stopping $gamename dedicated server: "
              	if ! ps -ef |grep ${basedir}/${gamebin}|awk -F" " -v game=${basedir}/${gamebin} 'BEGIN {status=1} ; $8 == game {status=0} ; END {exit status}' ; then
              		echo -e "server not running or crashed."
              	else
              			pid=`ps -ef |grep ${basedir}/${gamebin}|awk -F" " -v game=${basedir}/${gamebin} 'BEGIN {status=1} ; $8 == game { print $2 } ; END {exit status}'`
              			echo ${pid} > ${gamepid}
              			kill -9 `cat ${gamepid}`
              			if ! ps -ef |grep ${basedir}/${gamebin}|awk -F" " -v game=${basedir}/${gamebin} 'BEGIN {status=1} ; $8 == game {status=0} ; END {exit status}' ; then
              				echo -e "stopped"
              				exit 0
              			else
              				echo -e "unable to stop server or server crashed"
              			fi
              	fi
              	;;
              	status)
              	echo -n "`date +"%Y-%m-%d %H:%M:%S"` Checking $gamename dedicated server status: "
              	if ! ps -ef |grep ${basedir}/${gamebin}|awk -F" " -v game=${basedir}/${gamebin} 'BEGIN {status=1} ; $8 == game {status=0} ; END {exit status}' ; then
              		echo -e "server not running or crashed... Restarting"
              		if [ ${s_enable} == 1 ] ; then
              			cd ${basedir}
              			${screen} -d -m -L -S ${s_name} $0 debug
              		else
              			$0 start
              		fi
              	else
              		echo -e "Server still running."
              	fi
              	;;
              	check)
                      echo -n "Checking $gamename dedicated server status: "
                      if ! ps -ef |grep ${basedir}/${gamebin}|awk -F" " -v game=${basedir}/${gamebin} 'BEGIN {status=1} ; $8 == game {status=0} ; END {exit status}' ; then
                              echo -e "offline"
                      else
                              echo -e "online"
                      fi
                      ;;
              	restart)
              	echo -e "Restarting $gamename dedicated server... "
              	$0 stop && $0 start
              	;;
              	debug)
              	echo -n "Starting debug mode for $gamename dedicated server: "
                 	cd ${basedir}
                 	if ps -ef |grep ${basedir}/${gamebin}|awk -F" " -v game=${basedir}/${gamebin} 'BEGIN {status=1} ; $8 == game {status=0} ; END {exit status}' ; then
                 		echo -e "already active"
              		exit 3
              	 else
              		echo "--DEBUG will appear on screen!"
                 		echo "--Hit CTRL+C to kill the server!"
                 		cd ${basedir}
              		cp ${gamelog} ${gamelog}.crash
              		cd ${basedir}/LinuxServer/Engine/Binaries/Linux/
              		${basedir}/${gamebin} ${gameopt}
                 fi
              	;;
              	*)
                 echo "Usage: $0 {start|stop|restart|status|check|debug}"
                 exit 1
              esac

              Comment


                #37
                Hi,

                I don't know where is the problem, but I get this error everytime.




                Any idea ?
                Attached Files
                Xanarkan | Join us in our hub: FRA (Roubaix) Hub 1 - Raging.Network | Website | Forum

                Comment


                  #38
                  Originally posted by Xanarkan View Post
                  Hi,

                  I don't know where is the problem, but I get this error everytime.




                  Any idea ?
                  Yeah, sorry for the delay :X

                  You forgot to edit the ddut4.conf file, which is required unless your home directory for UT servers is the default of "/home/ut4". This is explicitly stated in the documentation.
                  Snir "DDRRE" Hassidim - Living and breathing UT since 2002!
                  "When Video Games and the Enterprise Meet" - Read my chronicles of building a gamers club at my workplace.
                  Facebook | LinkedIn

                  Comment

                  Working...
                  X