[KWA]SaVAgE Posted April 22, 2002 Share Posted April 22, 2002 For you Linux N00bs: First do "touch startjk" to create the server startup file. Second do "touch runjk" to create the restart script. startjk-- do a "vi startjk" then cut and paste the following.. "./jk2ded +exec server.cfg" NOTE there is a ./ (dot slash) before the name. runjk-- do a "vi runjk" then cut and paste the following.. #!/bin/sh while true do ./startjk sleep 10 done After having created both of these files (btw hit shift zz to quit and save the scripts) make them executable by doing the following.. chmod a+x startjk and chmod a+x runjk. These both need to be in the main JK2 dir, so now to start your server simply type in ./runjk The dot slash are needed btw. Hope this has been helpfull, I recieved about 7 requests for this and rather than replly to each of you I posted here. Link to comment Share on other sites More sharing options...
Soul-Burn Posted April 22, 2002 Share Posted April 22, 2002 Note, if you wanna insert any text in VI, you need to press i (as _i_nsert) and then paste it. Press ctrl-C or Escape to return to "command mode"... then press the Shift-zz to save&exit. Link to comment Share on other sites More sharing options...
MatrixCPA Posted April 22, 2002 Share Posted April 22, 2002 I like to have some logging with my restart script, so it looks like this: #!/bin/csh echo Ok while 1 date "+%D %H:%M:%S" >> /tmp/jk2_start.log echo "JK2 Server Started." >> /tmp/jk2_start.log sh startup.sh date "+%D %H:%M:%S" >> /tmp/jk2_start.log echo "JK2 Server crashed, Restarting." >> /tmp/jk2_start.log sleep 5 end That way I can see exactly how often and when the server has gone down. Link to comment Share on other sites More sharing options...
[KWA]SaVAgE Posted April 22, 2002 Author Share Posted April 22, 2002 Excellent addition, never even thought of adding logging! Originally posted by MatrixCPA I like to have some logging with my restart script, so it looks like this: #!/bin/csh echo Ok while 1 date "+%D %H:%M:%S" >> /tmp/jk2_start.log echo "JK2 Server Started." >> /tmp/jk2_start.log sh startup.sh date "+%D %H:%M:%S" >> /tmp/jk2_start.log echo "JK2 Server crashed, Restarting." >> /tmp/jk2_start.log sleep 5 end That way I can see exactly how often and when the server has gone down. Link to comment Share on other sites More sharing options...
MatrixCPA Posted April 22, 2002 Share Posted April 22, 2002 I'm working on testing a new script that logs the stderr to the same log file so that one can tell exactly HOW the server crashed (ie seg fault, etc). It's written using ksh because csh is dumb and can't separate the stdout from the stderr. *chuckle* Link to comment Share on other sites More sharing options...
rivmin Posted April 22, 2002 Share Posted April 22, 2002 I use bash, and a '2>&1' will put stderr in the same file as stdout. Link to comment Share on other sites More sharing options...
MatrixCPA Posted April 22, 2002 Share Posted April 22, 2002 I prefer to put it into the restart log file instead. That saves me the time of grep'ing for the crash data and it uses my timestamp instead of the server uptime stamp in the server log. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.