Calmcacil Posted January 7, 2012 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 4 Reputation: 2 Joined: 01/05/12 Last Seen: November 20, 2016 Share Posted January 7, 2012 (edited) The athena-start script could use some improvement, this is just a suggestion for a quick fix. What this does is basically telling the start script to sleep for 5 seconds before executing the map-server, I think this is useful due to the whole issue where you run restart and your map server doesnt get started because its still waiting for the old instance to close (cant bind Ip due to port in use.) that you generally experience upon calling a restart making the restart command not really do much unless the map server has actually crashed. edit: Adding a check to see if map server is already running, then posting new diff. edit2: Added check to see if the map server is already running, if it is the script will output this information to the user, wait for 5 seconds and then start the server, if its not found. It will start the map server normally. athena-start.diff Edited January 8, 2012 by Calmcacil 1 Quote Link to comment Share on other sites More sharing options...
CalciumKid Posted January 8, 2012 Group: Members Topic Count: 25 Topics Per Day: 0.01 Content Count: 257 Reputation: 253 Joined: 11/29/11 Last Seen: February 21, 2014 Share Posted January 8, 2012 I havent ever used the athena-start file without modifying it to use screen. Perhaps something that should be considered. 1 Quote Link to comment Share on other sites More sharing options...
Maki Posted January 8, 2012 Group: Members Topic Count: 146 Topics Per Day: 0.03 Content Count: 1195 Reputation: 467 Joined: 11/15/11 Last Seen: April 11, 2023 Share Posted January 8, 2012 I have personally never used it either. I've always used each server on its own screen (Screens: Login/Char/Map). Would be an interesting idea of athena-start automatically started all servers in their respective screens =] 2 Quote Link to comment Share on other sites More sharing options...
CalciumKid Posted January 8, 2012 Group: Members Topic Count: 25 Topics Per Day: 0.01 Content Count: 257 Reputation: 253 Joined: 11/29/11 Last Seen: February 21, 2014 Share Posted January 8, 2012 #!/bin/sh # athena starting script by rowla # modified by [email protected] (NL101541) PATH=./:$PATH L_SRV=login-server_sql C_SRV=char-server_sql M_SRV=map-server_sql print_start() { # more << EOF echo "Athena Starting..." echo " (c) 2003 Athena Project" echo " modified by [email protected]" echo "" #echo "Debug informations will appear," #echo "since this is a test release." #echo "" echo "checking..." #EOF } check_files() { for i in ${L_SRV} ${C_SRV} ${M_SRV} do if [ ! -f ./$i ]; then echo "$i does not exist, or can't run." echo "Stop. Check your compile." exit 1; fi done # more << EOF echo "Check complete." echo "Looks good, a nice Athena!" #EOF } case $1 in 'start') print_start check_files exec screen -d -m -S login .{L_SRV}& exec screen -d -m -S char ./${C_SRV}& exec screen -d -m -S map ./${M_SRV}& echo "Now Started Athena." echo "To view one of the servers type as shown:" echo "Login: screen -r login" echo "Char : screen -r char" echo "Map : screen -r map" echo "To stop viewing a screen hold Ctrl+A and tap D" ;; 'stop') ps ax | grep -E "${L_SRV}|${C_SRV}|${M_SRV}" | awk '{print $1}' | xargs kill ;; 'restart') $0 stop $0 start ;; *) echo "Usage: athena-start { start | stop | restart }" ;; esac as you wish sir. 1 Quote Link to comment Share on other sites More sharing options...
Lighta Posted January 9, 2012 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 737 Reputation: 216 Joined: 11/29/11 Last Seen: December 20, 2020 Share Posted January 9, 2012 (edited) Better use a while loop if you wanna do this check, since it may not finish on 5s. http://pastebin.com/jR91fv1U Also you check it's quite overkill with ps -ax, juste like the one in stop in fact instead using pkill. (btw stop quite annoying if you have multiple server running with same name). http://mywiki.wooledge.org/ProcessManagement Oh and little note I said to update this thing a month ago at least.. Edited January 9, 2012 by Lighta Quote Link to comment Share on other sites More sharing options...
fabs Posted January 18, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 2 Reputation: 0 Joined: 01/18/12 Last Seen: February 7, 2012 Share Posted January 18, 2012 Honestly, I don't see the point in improving the script when there are better alternatives. I use daemontools's supervise. My run scripts look similar to this: #!/bin/sh cd /eathena/server/trunk exec /eathena/server/trunk/char-server_sql > /dev/null This way, if the server crashes it automatically restarts. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.