Raised This Month: $51 Target: $400
 12% 

Linux hlds_run not automaticly restarting on crash


Post New Thread Reply   
 
Thread Tools Display Modes
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 03-02-2010 , 10:26   Re: Linux hlds_run not automaticly restarting on crash
Reply With Quote #61

Question regarding -timeout 6, does that allow to rerun the server?
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
8088
Veteran Member
Join Date: Jan 2008
Old 03-02-2010 , 10:52   Re: Linux hlds_run not automaticly restarting on crash
Reply With Quote #62

According to the Valve Developer Community it's just the Source alternative to Goldsource's -autoupdate.
__________________
steamID converter with OpenSearch browser plugin
8088 is offline
szczuro
New Member
Join Date: May 2010
Old 05-20-2010 , 14:35   Re: Linux hlds_run not automaticly restarting on crash
Reply With Quote #63

Hi. My english is no good, but i hope you can help me..

I created file "hlds_loop" without extension and "chmod +x" on my dedicated serwer with this text :

Code:
#! /bin/bash
export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH"

while [ true ]; do
        ./hlds_run -game cstrike -tos -pingboost 1 +maxplayers 21 +map de_dust2 +port 27029 +exec server.cfg +ip 19.132.13.13
        echo "Server crashed at '`date`' - Restarting"
        echo "Server crashed at '`date`' - Restarting" >> crash.log
        sleep 5
done
when i put in linux command line :
Code:
./hlds_loop
i see this error :

Code:
-bash: ./hlds_loop: /bin/bash^M: bad interpreter: Nie ma takiego pliku ani katalogu (in english : There is no file or directory)
Can you help me?
szczuro is offline
tulga
Junior Member
Join Date: May 2010
Old 05-21-2010 , 08:35   Re: Linux hlds_run not automaticly restarting on crash
Reply With Quote #64

Quote:
Originally Posted by vampire2k View Post
-autoupdate didn't work either but i got around to write that script, if anyones interested:
Code:
#! /bin/bash
export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH"

while [ true ]; do
        ./hlds_i686 -game ns -maxplayers 32 -pingboost 1 +map co_faceoff +ip 78.143.28.20
        echo "Server crashed at '`date`' - Restarting"
        echo "Server crashed at '`date`' - Restarting" >> crash.log
        sleep 5
done
This seems to work, thread can be closed
That's not good idea. The hanged ./hlds always exist in memory. First we must check ./hlds is running or not. if not runnig try to kill hanged hlds then we must hlds.
tulga is offline
vampire2k
SourceMod Donor
Join Date: Oct 2005
Location: Germany
Old 05-21-2010 , 09:26   Re: Linux hlds_run not automaticly restarting on crash
Reply With Quote #65

My script doesn't support frozen instances, so yes - its a bad idea if you encounter that behaviour. Feel free to add some sort of killing mechanism for it though (the power of open source ).
vampire2k is offline
tulga
Junior Member
Join Date: May 2010
Old 05-21-2010 , 09:49   Re: Linux hlds_run not automaticly restarting on crash
Reply With Quote #66

Code:
#! /bin/bash

./hlds_i686 -game ns -maxplayers 32 -pingboost 1 +map co_faceoff +ip 78.143.28.20 -pidfile pidfile.txt &> logfile.txt
sleep 5

while [ true ]; do
  IS_CRASHED=`tail -n 1 logfile.txt | grep "^\./hlds_run:.*Segmentation fault"`
  if test -n "$IS_CRASHED"; then
    echo "Server crashed at '`date`' - Restarting"
    echo "Server crashed at '`date`' - Restarting" >> crashlog.txt
    PID=`tail -n 1 pidfile.txt`
    kill $PID
    ./hlds_i686 -game ns -maxplayers 32 -pingboost 1 +map co_faceoff +ip 78.143.28.20 -pidfile pidfile.txt &> logfile.txt
  fi
  sleep 5
done
Not Yet Tested

Last edited by tulga; 05-21-2010 at 09:50. Reason: Not Yes tested ...
tulga is offline
szczuro
New Member
Join Date: May 2010
Old 05-24-2010 , 14:27   Re: Linux hlds_run not automaticly restarting on crash
Reply With Quote #67

Someone can help me?
szczuro is offline
valentin1000
Junior Member
Join Date: May 2006
Old 01-31-2013 , 17:51   Re: Linux hlds_run not automaticly restarting on crash
Reply With Quote #68

Hello everyone, it may be a little late to respond to this thread, but I think it can help to more than one, because I've applied the solution to the problem with we use the "rcon quit", that cause a crash of the server.

I made this:
1.- Locate file hlds_run and open to edit
2.- Locate in Line 17 --> DEBUG=0
3.- Change with --> DEBUG=""
4.- Locate in Line 336 --> update
5.- Change with --> # update
6.- Locate in Line 354 --> update
7.- Change with --> # update
8.- Save the file hlds_run

It's all.

Now you can run your server with this start (for example... my server is dod 1.3):

screen -A -m -d -S dod ./hlds_run -console -game dod -autoupdate +ip XX.XX.XX.XX +port 27015 +map dod_anzio -maxplayers 24 +sys_ticrate 1000

NOW when you use "rcon quit", the server RESTART are perfectly.

Note 1: My SO is debian-6.0-x86_64
Note 2: Valve no longer provides support to the games HL1

Last edited by valentin1000; 01-31-2013 at 17:53.
valentin1000 is offline
xfirestorm
Member
Join Date: Mar 2012
Old 02-04-2013 , 03:06   Re: Linux hlds_run not automaticly restarting on crash
Reply With Quote #69

Quote:
Originally Posted by szczuro View Post
Someone can help me?
#! /bin/bash
change to:
#!/bin/bash

No space between ! and /

As for restarts, I just run my server with -debug option and it restarts automatically after crash.

Last edited by xfirestorm; 02-04-2013 at 03:16.
xfirestorm is offline
RoboCop
AlliedModders Donor
Join Date: Dec 2010
Location: Dundee, Scotland
Old 05-11-2013 , 14:38   Re: Linux hlds_run not automaticly restarting on crash
Reply With Quote #70

Have you tried putting this code inside hlds_run_autostart?

Code:
#!/bin/bash
export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH"

while [ true ]; do
        ./hlds_run
        echo "Server crashed at '`date`' - Restarting"
        echo "Server crashed at '`date`' - Restarting" >> crash.log
        sleep 5
done
I was sure that would work but it doesn't on my server for some reason and I don't quite know or make sense of it...
__________________
vBulletin Webmaster Since 2001
Bots-United Webmaster and Botmaster
RoboCop is offline
Send a message via Skype™ to RoboCop
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode