Raised This Month: $32 Target: $400
 8% 

Linux hlds_run not automaticly restarting on crash


Post New Thread Reply   
 
Thread Tools Display Modes
8088
Veteran Member
Join Date: Jan 2008
Old 12-09-2009 , 18:11   Re: Linux hlds_run not automaticly restarting on crash
Reply With Quote #21

Think of it as an alternative to hlds_run, which you usually execute by typing something like this:
Code:
./hlds_run -console -game <game> +ip <ip> -port <port> +maxplayers <xx> +map <mapname> -autoupdate
So, create a new file in the same directory, paste the content as posted above (don't forget to change the parameters to your specific needs), save it as alt_hlds_run (or whatever you prefer) and chmod +x it (make it executable). And execute it by simply typing
Code:
./alt_hlds_run
Whenever the server crashes, it will log the date and time of the occurrance to ./crash.log.
__________________
steamID converter with OpenSearch browser plugin
8088 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-09-2009 , 23:06   Re: Linux hlds_run not automaticly restarting on crash
Reply With Quote #22

Thanks, but I don't understand as to how to make it executable.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-09-2009 , 23:24   Re: Linux hlds_run not automaticly restarting on crash
Reply With Quote #23

Quote:
Originally Posted by Exolent[jNr] View Post
Thanks, but I don't understand as to how to make it executable.
Usually scripts are named without an extension. So you would just name it without it (you can do this with Notepad++ simply by providing the name with no extension and make sure the "save as type" is "All types (*.*)").

You then need to make it executable. chmod = change mode(?) to make it able to be executed. You can do this with ftp. Probably by right clicking and selecting properties.
__________________
fysiks is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-09-2009 , 23:46   Re: Linux hlds_run not automaticly restarting on crash
Reply With Quote #24

When I try to execute it, I get this:
Code:
./hlds_run_autorestart: /bin/bash^M: bad interpreter: No such file or directory
I set the execute permissions and saved it without an extension (saved with all types in notepad).

Here is the script I input:
Code:
#! /bin/bash
export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH"

while [ true ]; do
        ./hlds_run -game cstrike +maxplayers 16 +map de_cbble +port 27016 -debug
        echo "Server crashed at '`date`' - Restarting"
        echo "Server crashed at '`date`' - Restarting" >> crash.log
        sleep 5
done
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-10-2009 , 00:04   Re: Linux hlds_run not automaticly restarting on crash
Reply With Quote #25

Quote:
Originally Posted by Exolent[jNr] View Post
I set the execute permissions and saved it without an extension (saved with all types in notepad).
You used Notepad that came with Windows? In XP, Notepad will automatically put a .txt extension on it. That would explain it not being able to find the file.

Notepad++ will do it correctly.
__________________
fysiks is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 12-10-2009 , 00:11   Re: Linux hlds_run not automaticly restarting on crash
Reply With Quote #26

Attached Files
File Type: zip hlds_run_autorestart.zip (368 Bytes, 360 views)
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-10-2009 , 00:47   Re: Linux hlds_run not automaticly restarting on crash
Reply With Quote #27

Quote:
Originally Posted by fysiks View Post
You used Notepad that came with Windows? In XP, Notepad will automatically put a .txt extension on it. That would explain it not being able to find the file.

Notepad++ will do it correctly.
No, I did do it correctly with Notepad++.

Mine:
http://img15.**************/img15/555...2009234245.jpg

One's attached file:
http://img15.**************/img15/371/12092009234322.jpg

I'm using Win7, also.

FTP File Screenshot:
http://img27.**************/img27/764...2009234507.jpg

FTP File Permissions:
http://img705.**************/img705/3...2009234548.jpg
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 12-10-2009 , 01:10   Re: Linux hlds_run not automaticly restarting on crash
Reply With Quote #28

you tried my code exolent? i did it with pico ( ubuntu )
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-10-2009 , 01:14   Re: Linux hlds_run not automaticly restarting on crash
Reply With Quote #29

Your code is no different than mine.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-10-2009 , 01:16   Re: Linux hlds_run not automaticly restarting on crash
Reply With Quote #30

it's in the wrong folder. It should be right next to hlds_run which is parallel to /cstrike/.
__________________
fysiks is offline
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 14:38.


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