Сервер не перезапускается после падения

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
5
Реакции
1
Ошибка
В amxmodx/logs error'ов по возникшей проблеме нет
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5263 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Oct 27 2019 16:23:31
Built from: https://github.com/alliedmodders/amxmodx/commit/15a14a0
Build ID: 5263:15a14a0
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.7.0.692-dev
Build date: 18:58:01 Sep 21 2019 (1988)
Build from: https://github.com/dreamstalker/rehlds/commit/e7232be
ReGamedll
ReGameDLL version: 5.12.0.425-dev
Build date: 08:48:23 Nov 2 2019
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/fd06d65
Версия Metamod
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:54 Aug 24 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0cf2f70
Список метамодулей
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] Reunion RUN - reunion_mm_i386.so v0.1.75 ini Start Never
[ 2] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 3] Revoice RUN - revoice_mm_i386.so v0.1.0.33 ini Start Never
[ 4] WHBlocker RUN - whblocker_mm_i386.so v1.5.696 ini Chlvl ANY
[ 5] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 6] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 7] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5263 ini Start ANY
[ 8] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5263 pl7 ANY ANY
[ 9] MySQL RUN - mysql_amxx_i386.so v1.9.0.5263 pl7 ANY ANY
[10] Engine RUN - engine_amxx_i386.so v1.9.0.5263 pl7 ANY ANY
[11] ReAPI RUN - reapi_amxx_i386.so v5.11.0.190-dev pl7 ANY Never
[12] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl7 ANY Never
[13] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5263 pl7 ANY ANY
[14] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5263 pl7 ANY ANY
[15] Fun RUN - fun_amxx_i386.so v1.9.0.5263 pl7 ANY ANY
[16] CSX RUN - csx_amxx_i386.so v1.9.0.5263 pl7 ANY ANY
16 plugins, 16 running
Список плагинов
Currently loaded plugins:
name version author file status
[ 1] DiveBanX 2019.0 RevCrew DiveBanX.amxx running
[ 2] AfterBan 2019.0 RevCrew AfterBan.amxx running
[ 3] Admin Commands 1.9.0.5263 AMXX Dev Team admincmd.amxx running
[ 4] Menus Front-End 18.12.18 AMXX Dev Team & amxmodmenu_rbs. running
[ 5] Commands Menu 1.9.0.5263 AMXX Dev Team cmdmenu.amxx running
[ 6] Players Menu 1.7 neugomon players_menu.am running
[ 7] [183] MapsMenu RBS 19.09.01 SKAJIbnEJIb & AM mapsmenu_rbs.am running
[ 8] Plugin Menu 1.9.0.5263 AMXX Dev Team pluginmenu.amxx running
[ 9] Admin Chat 1.9.0.5263 AMXX Dev Team adminchat.amxx running
[ 10] Anti Flood 1.9.0.5263 AMXX Dev Team antiflood.amxx running
[ 11] Admin Votes 1.9.0.5263 AMXX Dev Team adminvote.amxx running
[ 12] [183] MapChooser RBS 18.10.05 SKAJIbnEJIb & UF mapchooser_rbs. running
[ 13] [183] TimeLeft 18.09.25 SKAJIbnEJIb & AM timeleft.amxx running
[ 14] Pause Plugins 1.9.0.5263 AMXX Dev Team pausecfg.amxx running
[ 15] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 16] Chat Manager 1.1.1-11 Mistrick chatmanager.amx running
[ 17] Auto Restart 1.0 AbeX auto_rr.amxx running
[ 18] [183] High Ping Kicker 19.01.30 SKAJIbnEJIb hpk_rbs.amxx running
[ 19] AFK Control 1.4.1 [Rnd neygomon afk_control.amx running
[ 20] Admin ESP 0.3 unnamed & miRror admin_esp.amxx running
[ 21] GameName Changer 1.0 neugomon gamename.amxx running
[ 22] Killer ScreenFade 0.0.5 Vaqtincha killer_screenfa running
[ 23] Knife Duel 1.6 Name_PKD knife_duel.amxx running
[ 24] Parachute 1.1 ReHLDS Team reparachute.amx running
[ 25] Reset Score 0.0.2f wopox1337 resetscore.amxx running
[ 26] RC BaseChanger 1.0 phe rc_basechanger. stopped
[ 27] Rechecker Log 0.1 F@nt0M rc_log.amxx running
[ 28] Double Jump 0.1 pro100web menujump.amxx running
[ 29] Advert Messages 1.22 neygomon adverts.amxx running
[ 30] [183] PTB RBS 17.10.30 Ptahhotep & SKAJ ptb_rbs.amxx running
[ 31] [183] Ultimate Gag 17.12.22BE SKAJIbnEJIb ultimate_gag.am running
[ 32] [ReAPI][183] Ultimate 17.08.28 SKAJIbnEJIb ultimate_gag_re running
[ 33] [183] Ultimate Flags 18.12.16 SKAJIbnEJIb ultimate_flags. running
[ 34] [190] Ultimate Models 19.12.07 SKAJIbnEJIb ultimate_models running
[ 35] [182] Demo Recorder RB 18.02.08 SKAJIbnEJIb demorecorder_rb running
[ 36] CSRankMax 2019.0 RevCrew CSRankMax.amxx running
[ 37] Weapon Models API 0.5.0-16 Mistrick weapon_models_a running
37 plugins, 36 running
Доброго времени суток, Уважаемые форумчане!
В общих словах, суть проблемы такова...
При смене карты падает сервер и не перезапускается сам.

В момент падения появились crash логи в
----------------------------------------------
CRASH: Sun Dec 8 07:31:26 MSK 2019
Start Line: ./hlds_linux -debug -game cstrike -norestart -condebug -sys_ticrate 1100 +servercfgfile server.cfg +sys_ticrate 1100 +map awp_india +maxplayers 24 +ip 37.230......... +port 27016 +sv_lan 0 -secure -pingboost 3 -pidfile hlds.22785.pid
[New LWP 22792]
[New LWP 22812]
[New LWP 22814]
[New LWP 22818]
[New LWP 26767]
#0 0xb6e87ba3 in ?? ()
End of crash report
----------------------------------------------

----------------------------------------------
CRASH: Mon Dec 9 19:24:07 MSK 2019
Start Line: ./hlds_linux -debug -game cstrike -norestart -condebug -sys_ticrate 1100 +servercfgfile server.cfg +sys_ticrate 1100 +map awp_india +maxplayers 24 +ip 37.230......... +port 27016 +sv_lan 0 -secure -pingboost 3 -pidfile hlds.27798.pid
[New LWP 27811]
[New LWP 27828]
[New LWP 6229]
[New LWP 27832]
[New LWP 27826]
#0 0xb6e44ba3 in ?? ()
End of crash report
----------------------------------------------
----------------------------------------------
CRASH: Thu Dec 12 06:26:40 MSK 2019
Start Line: ./hlds_linux -debug -game cstrike -norestart -condebug -sys_ticrate 1100 +servercfgfile server.cfg +sys_ticrate 1100 +map awp_india +maxplayers 24 +ip 37.230........ +port 27016 +sv_lan 0 -secure -pingboost 3 -pidfile hlds.18581.pid
[New LWP 18594]
[New LWP 18609]
[New LWP 18611]
[New LWP 18615]
[New LWP 19759]
#0 0xb6eabba3 in ?? ()
End of crash report
----------------------------------------------
----------------------------------------------
CRASH: Fri Dec 13 17:04:30 MSK 2019
Start Line: ./hlds_linux -debug -game cstrike -norestart -condebug -sys_ticrate 1100 +servercfgfile server.cfg +sys_ticrate 1100 +map awp_india +maxplayers 24 +ip 37.230........ +port 27016 +sv_lan 0 -secure -pingboost 3 -pidfile hlds.28805.pid
[New LWP 28817]
[New LWP 28837]
[New LWP 28842]
[New LWP 28835]
#0 0xb6ec4ba3 in ?? ()
End of crash report
----------------------------------------------

И так же, в соответствующее время, появились логи в
L 08/12/2019 - 07:31:26: (map "awp_heat") Mod_LoadModel: models/awp_heat/lag_palm240_256.mdl not found
L 09/12/2019 - 19:24:07: (map "awp_sunburn") TEX_InitFromWad: couldn't open fatality.wad

L 12/12/2019 - 06:26:40: (map "awp_defeat2") Mod_LoadModel: models/palmier_large.mdl not found
L 13/12/2019 - 17:04:30: (map "awp_lego_by_navajobr") TEX_InitFromWad: couldn't open awp-lego-wad-cruellklan.wad

Ну да ладно, не хватает файлов картам, карты эти отключил.
Но не дает покоя то, что сервер сам не запускается после таких падений. И хочется предотвратить повторение подобных не запусков сервера.
В debug.log меня очень смущает параметр запуска сервера -norestart
Поискав команды запуска сервера, нашел, что -norestart - Отключает перезапуск сервера при ошибке.
Сервер на VDS. Установлена панель управления. В панели управления данные параметры отредактировать нет возможности.
В связи с этим и прошу помощи.
Может кто-то может подредактировать файлик hlds_run ? Убрать этот параметр -norestart, без вреда для кода содержащегося в этом файле.
Может без этого параметра не будет таких проблем с автоматическим перезапуском сервера после падений
P.S. Надеюсь я правильно понимаю что именно этот файл hlds_run отвечает за запуск сервера? ;)

PHP:
#!/bin/sh
#
#       Copyright (c) 2002, Valve LLC. All rights reserved.
#
#    a wrapper script for the main hl dedicated server binary.
#    Performs auto-restarting of the server on crash. You can
#    extend this to log crashes and more.
#

# setup the libraries, local dir first!
export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH"

init() {
    # Initialises the various variables
    # Set up the defaults
    GAME="valve"
    DEBUG=0
    RESTART="yes"
    HL=./hlds_linux
    HL_DETECT=1
    TIMEOUT=10 # time to wait after a crash (in seconds)
    CRASH_DEBUG_MSG="email debug.log to [email protected]"
    GDB="gdb" # the gdb binary to run
    DEBUG_LOG="debug.log"
    PID_FILE=""
    STEAM=""
    STEAMERR=""
    SIGINT_ACTION="quit 0" # exit normally on sig int
    NO_TRAP=0
    AUTO_UPDATE=""
    BETA_VERSION=""
    PARAMS=$*

    # Remove any old default pid files
    # Cant do this as they may be still running
    #rm -f hlds.*.pid

    # use the $FORCE environment variable if its set
    if test -n "$FORCE" ; then
        # Note: command line -binary will override this
        HL=$FORCE
        HL_DETECT=0
    fi

    while test $# -gt 0; do
        case "$1" in
        "-game")
            GAME="$2"
            shift ;;
        "-debug")
            DEBUG=1
            # Ensure that PID_FILE is set
            if test -z "$PID_FILE"; then
                PID_FILE="hlds.$$.pid"
            fi ;;
        "-norestart")
            RESTART="" ;;
        "-pidfile")
            PID_FILE="$2"
            shift ;;
        "-binary")
            HL="$2"
            HL_DETECT=0
            shift ;;
        "-timeout")
            TIMEOUT="$2"
            shift ;;
        "-gdb")
            GDB="$2"
            shift ;;
        "-debuglog")
            DEBUG_LOG="$2"
            shift ;;
        "-autoupdate")
            AUTO_UPDATE="yes"
            STEAM="steamcmd/steamcmd.sh"
            RESTART="yes" ;;
        "-steamerr")
            STEAMERR=1 ;;
        "-ignoresigint")
            SIGINT_ACTION="" ;;
        "-notrap")
            NO_TRAP=1 ;;
        "-beta")
            BETA_VERSION="$2"
            shift ;;
        "-help")
            # quit with syntax
            quit 2
            ;;
        esac
        shift
    done

    # Ensure we have a game specified
    if test -z "$GAME"; then
        echo "Unable to determine game type from command line."
        quit 1
    elif test ! -d "$GAME"; then
        echo "Invalid game type '$GAME' sepecified."
        quit 1
    fi

    #if test 0 -eq "$NO_TRAP"; then
        # Set up the int handler
        # N.B. Dont use SIGINT symbolic value
        #  as its just INT under ksh
        #trap "$SIGINT_ACTION" 2
    #fi

    if test ! -f "$HL"; then
        echo "Half-life binary '$HL' not found, exiting"
        quit 1
    elif test ! -x "$HL"; then
        # Could try chmod but dont know what we will be
        # chmoding so just fail.
        echo "Half-life binary '$HL' not executable, exiting"
        quit 1
    fi

    # Setup debugging
    if test "$DEBUG" -eq 1; then
        #turn on core dumps :) (if possible)
        echo "Enabling debug mode"
        if test "`ulimit -c`" -eq 0 ; then
            ulimit -c 2000
        fi
        GDB_TEST=`$GDB -v`
        if test -z "$GDB_TEST"; then
            echo "Please install gdb first."
            echo "goto http://www.gnu.org/software/gdb/ "
            DEBUG=0 # turn off debugging cause gdb isn't installed
        fi
    fi

    PID_IN_PARAMS="`echo $PARAMS | grep -e -pidfile`"

    if test -z "$PID_IN_PARAMS" && test -n "$PID_FILE"; then
        HL_CMD="$HL $PARAMS -pidfile $PID_FILE"
    else
        HL_CMD="$HL $PARAMS"
    fi
}

syntax () {
    # Prints script syntax

    echo "Syntax:"
    echo "$0 [-game <game>] [-debug] [-norestart] [-pidfile]"
    echo "    [-binary [hlds_linux]"
    echo "    [-timeout <number>] [-gdb <gdb>] [-autoupdate]"
    echo "    [-steamerr] [-ignoresigint] [-beta <version>]"
    echo "  [-debuglog <logname>]"
    echo "Params:"
    echo "-game <game>            Specifies the <game> to run."
    echo "-debug                  Run debugging on failed servers if possible."
    echo "-debuglog <logname>    Log debug output to this file."
    echo "-norestart              Don't attempt to restart failed servers."
    echo "-pidfile <pidfile>      Use the specified <pidfile> to store the server pid."
    echo "-binary <binary>        Use the specified binary ( no auto detection )."
    echo "-timeout <number>       Sleep for <number> seconds before restarting"
    echo "            a failed server."
    echo "-gdb <gdb>              Use <dbg> as the debugger of failed servers."
    echo "-steamerr               Quit on steam update failure."
    echo "-beta <version>        Make use of a beta version of this server from Steam"
    echo "-ignoresigint           Ignore signal INT ( prevents CTRL+C quitting"
    echo "            the script )."
    echo "-notrap                 Don't use trap. This prevents automatic"
    echo "            removal of old lock files."
    echo ""
    echo "Note: All parameters specified as passed through to the server"
    echo "including any not listed."
}

debugcore () {
    # Debugs any core file if DEBUG is set and
    # the exitcode is none 0

    exitcode=$1

    if test $exitcode -ne 0; then
        if test -n "$DEBUG" ; then
            echo "bt" > debug.cmds;
            echo "info locals" >> debug.cmds;
            echo "info sharedlibrary" >> debug.cmds
            echo "info frame" >> debug.cmds;  # works, but gives an error... must be last
            echo "----------------------------------------------" >> $DEBUG_LOG
            echo "CRASH: `date`" >> $DEBUG_LOG
            echo "Start Line: $HL_CMD" >> $DEBUG_LOG

            # check to see if a core was dumped
            if test -f core ; then
                CORE="core"
            elif test -f core.`cat $PID_FILE`; then
                CORE=core.`cat $PID_FILE`
            elif test -f "$HL.core" ; then
                CORE="$HL.core"
            fi
           
            if test -n "$CORE"; then
                $GDB $HL $CORE -x debug.cmds -batch >> $DEBUG_LOG
            fi
       
            echo "End of crash report" >> $DEBUG_LOG
            echo "----------------------------------------------" >> $DEBUG_LOG
            echo $CRASH_DEBUG_MSG
            rm debug.cmds
        else
            echo "Add \"-debug\" to the $0 command line to generate a debug.log to help with solving this problem"
        fi
    fi
}


update() {
    updatesingle
}

updatesingle() {
    # Run the steam update
    # exits on failure if STEAMERR is set

    if test -n "$AUTO_UPDATE"; then
        if test -f "$STEAM"; then
            echo "Updating server using Steam."
            CMD="$STEAM +logon anonymous +force_install_dir .. +app_update 90 +quit";
            if  test -n "$BETA_VERSION"; then
              CMD="$CMD -beta $BETA_VERSION";
            fi
           
            STEAMEXE=steamcmd $CMD
            if test $? -ne 0; then
                if test -n "$STEAMERR"; then
                    echo "`date`: Steam Update failed, exiting."
                    quit 1
                else
                    echo "`date`: Steam Update failed, ignoring."
                    return 0
                fi
            fi
        else
            if test -n "$STEAMERR"; then
                echo "Could not locate steam binary:$STEAM, exiting.";
                quit 1
            else
                echo "Could not locate steam binary:$STEAM, ignoring.";
                return 0
            fi
        fi
    fi

    return 1
}
   
run() {
    # Runs the steam update and server
    # Loops if RESTART is set
    # Debugs if server failure is detected
    # Note: if RESTART is not set then
    # 1. DEBUG is set then the server is NOT exec'd
    # 2. DEBUG is not set the the server is exec'd

    if test -n "$RESTART" ; then
        echo "Auto-restarting the server on crash"

        #loop forever
        while true
        do
            # Update if needed
            update

            # Run the server
            $HL_CMD
            retval=$?
            if test $retval -eq 0 && test -z "$RESTART" ; then
                break; # if 0 is returned then just quit
            fi

            debugcore $retval

            echo "`date`: Server restart in $TIMEOUT seconds"

            # don't thrash the hard disk if the server dies, wait a little
            sleep $TIMEOUT
        done # while true
    else
        # Update if needed
        update

        # Run the server
        if test "$DEBUG" -eq 0; then
            # debug not requested we can exec
            exec $HL_CMD
        else
            # debug requested we can't exec
            $HL_CMD
            debugcore $?
        fi
    fi
}

quit() {
    # Exits with the give error code, 1
    # if none specified.
    # exit code 2 also prints syntax
    exitcode="$1"

    # default to failure
    if test -z "$exitcode"; then
        exitcode=1
    fi

    case "$exitcode" in
    0)
        echo "`date`: Server Quit" ;;
    2)
        syntax ;;
    *)
        echo "`date`: Server Failed" ;;
    esac

    # Remove pid file
    if test -n "$PID_FILE" && test -f "$PID_FILE" ; then
        # The specified pid file
        rm -f $PID_FILE
    fi

    # reset SIGINT and then kill ourselves properly
    trap - 2
    kill -2 $$
}

# Initialise
init $*

# Run
run

# Quit normally
quit 0
 
В этой теме было размещено решение! Перейти к решению.

Вложения

Сообщения
3,023
Реакции
1,731
Помог
79 раз(а)
oliver39, ./hlds_linux -game cstrike -debug -condebug -pingboost 3 -sys_ticrate 1100 +servercfgfile server.cfg +map awp_india +maxplayers 24 +ip 37.230......... +port 27016 +sv_lan 0 -secure
 
Сообщения
5
Реакции
1
Алексеич, спасибо конечно ;)
Но нет возможности в таком виде параметры запуска сервера отредактировать.
Была бы такая возможность,убрал бы давно этот параметр -norestart.
Нашел только, что в hlds_run отредактировать.
А я в этих кодах, к сожалению, вообще не соображаю.
Да вижу в файле hlds_run этот параметр, а вот как его корректно оттуда убрать не знаю.
 
Сообщения
5
Реакции
1
Алексеич, заменил. Сервер запустился.
А может есть такая возможность, чтобы посмотреть с какими параметрами сервер запущен? Может в консоли сервера как-то?
Если нет такой возможности, то вижу только такой выход для проверки перезапуска сервера.
Включать обратно те карты, менять на них, и ожидать появления crash логов.
 
Сообщения
3,023
Реакции
1,731
Помог
79 раз(а)
oliver39, вроде нельзя посмотреть. это же выполнение процесса линукса, а не кс.
 
Сообщения
5
Реакции
1
Алексеич, спасибо тебе огромнейшее, добрый ты человек!!! :thank_you:
Сервер теперь сразу перезапускается после падения :dirol:

Извиняй, вот только не знаю где тут тебе Спасибо нажать ;)
 
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу