Howdy folks, for Cyle this one, a) sorry for the latesness of this post, only just read the digest and b) sorry for the length.
I use a script (hlds_script) cribbed from another site some time ago, I will add it below in a sec. I'm running SuSE Linux, where you stick the script changes with some distros, on this one I have a copy in /etc/rc.d The SuSE setup has a set of startup directory rc0.d .. rc1.d and so on. In rc3.d I have symbolic link to the hlds_ script below (or you can link it direct to hlds). When the machine boots or reboots and goes through the startup scripts it calls the script and starts Hlds accordingly. I am running halfStats and found that every so often something goes awry with the logging output from hlds, so I have a cron job do a restart on the server via the startup script every few hours or so. At most a few mins worth of logs will be lost. Crontab line is :- -0 5,10,15,20 * * * * root /etc/rc.d/hlds_script restart which restarts the server every 5 hours or so. The '-' at the front stops cron from writing to syslog about the command. If you need to restart by hand - say you've made a change to the config files, just type /etc/rc.d/hlds_script restart (or stop, start accordingly). You will have to edit some of the lines, paths for sure and almost certainly the startup parameters for hlds. A final note, the script requires that you have 'screen' installed, which allows execution of the hlds in the background. When its going you can get into the running hlds server console by typing 'screen -r'. I normally get out by running screen -d in another shell, but there could be a way of doing it with the screen commands (which are many and confusing :) ) Heres the script, with thanks to Julien and Cedric for authoring it n the first place. The comments are excellent. ######### start - copy from the line below, dont include this line #! /bin/sh # # Start the Counter-Strike dedicated server. # # AUTHORS : # # Julien Escario ( [EMAIL PROTECTED] ) # & # Cedric Rochat ( [EMAIL PROTECTED] ) # # =========================================== # # What you need: # # Linux :) # awk # screen # the hlds_l & cstrike-files # # How to use: # # Edit the DIR-Var to fit your system (just contains the path to the dir that contains hlds_run) # Edit the PARAMS-Var to fit your needs # - standard is startup as LAN-server # # When this is done, copy the file to /etc/rc.d/init.d (or whereever your system stores the # scripts for starting the services # Now you can link the script to your runlevel-dir, here's an example for runlevel 3: #ln -s /usr/local/games/hlds_l/hlds /etc/rc.d/rc3.d/S90hlds #ln -s /usr/local/games/hlds_l/hlds /etc/rc.d/rc3.d/K50hlds # # Or use it manualy like: # /etc/rc.d/init.d/hlds start # /etc/rc.d/init.d/hlds stop # # How to see the server-console: # # Just type in: screen -r cstrike # More info about screen can be found by typing "man screen" or using this nice link # http://server.counter-strike.net/help/linuxscreen.html # # If you don't want to start the server as root you have to change this: # edit the var CS_USER and uncomment it # change the lines at the "start-block" # # You must be logged in as this user to re-attach the screen! # # DOC by jwm ([EMAIL PROTECTED]) clear # Edit and uncomment it to run the server as non-root # CS_USER="jwm" PATH=/bin:/usr/bin:/sbin:/usr/sbin # # DON'T FORGET TO CHANGE THE PATH TO YOUR NEEDS! DIR=/usr/local/games/hlds_l DAEMON=$DIR/hlds_run # LAN-server: PARAMS="-game valve +map crossfire +maxplayers 16" # Internet-server: NAME=DMB DESC="Halflife dedicated server" case "$1" in start) echo "Starting $DESC: $NAME" cd $DIR # Change the lines for running as non-root! # su $CS_USER -l -c "screen -d -m -S $NAME $DAEMON $PARAMS" screen -d -m -S $NAME $DAEMON $PARAMS ;; stop) if [[ `screen -ls |grep $NAME` ]] then echo -n "Stopping $DESC: $NAME" kill `screen -ls |grep $NAME |awk -F . '{print $1}'|awk '{print $1}'` echo " ... done." else echo "Coulnd't find a running $DESC" fi ;; restart) if [[ `screen -ls |grep $NAME` ]] then echo -n "Stopping $DESC: $NAME" kill `screen -ls |grep $NAME |awk -F . '{print $1}'|awk '{print $1}'` echo " ... done." else echo "Coulnd't find a running $DESC" fi echo -n "Starting $DESC: $NAME" cd $DIR screen -d -m -S $NAME $DAEMON $PARAMS echo " ... done." ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;; esac exit 0 ######### end of script -- best wishes and blessings, Steve mailto:[EMAIL PROTECTED] _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlds_linux

