Dobrý den,
udělal jsem si ovladani hernich serveru prez web. je to vlastně apliakce hlds_run ktera se spustí.
Spouštění serverů probíhá v pořádku
Ale vypinani té aplikace je problematické, hlds_run je nejaky bash se spoustou parametrů a je v něm nastavený auto restart serveru pri spadnuti, cili ho nemuzu zabit killem. pak je v hlds_run moznost nastavit nejaky PID_file a jestli jsem to dobře pochopil tak by si to z toho pid filu melo brat PID CISLO, to by se mi pomerne hodilo nastavit abych to mohl prez kill zabijet.
Prvni me reseni vypinani bylo exec('screen -d -r hlds1 && quit') quit je prikaz na vypnuti te aplikace, bohuzel to vyhodi hlasku ze musim byt pripojeny k terminalu.
tak je podle me uz asi jedine reseni vnutit tomu PID a zabijet to killem s vypnutym autorestaretem serveru
Poradte:)
hlds run toto je pouhá část toho hlds_run ale asi nejdulezitesi pro moje uceli
#!/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=""
RESTART="no"
HL=./hlds_i486
HL_DETECT=1
TIMEOUT=10 # time to wait after a crash (in seconds)
CRASH_DEBUG_MSG="email debug.log to linux@valvesoftware.com"
GDB="gdb" # the gdb binary to run
DEBUG_LOG="debug.log"
PID_FILE="" # only needed it DEBUG is set so init later
STEAM=""
PID_FILE_SET=1
STEAMERR=""
SIGINT_ACTION="quit 0" # exit normally on sig int
NO_TRAP=0
AUTO_UPDATE=""
STEAM_USER=""
STEAM_PASSWORD=""
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