12-03-2013, 10:03 PM
Hi Guys,
I Search .sh restarter for linux. If one gameserver get crash or something its automatically restart. Its possilbe to write script or etc ?
If yes please give me script for it.
Thanks
|
auto restarter (LINUX)
|
|
12-03-2013, 10:03 PM
Hi Guys, I Search .sh restarter for linux. If one gameserver get crash or something its automatically restart. Its possilbe to write script or etc ? If yes please give me script for it. Thanks
12-03-2013, 11:11 PM
show us your current .sh file please. I can tell you what to add.
12-04-2013, 06:13 AM
show us your current .sh file please. I can tell you what to add. My start2.sh (chanel 1) #!/bin/sh cd /opt/7.GameServer/GameServer2 ./GameServer_d start & start4.sh (chanel 2) #!/bin/sh cd /opt/8.GameServer/GameServer2 ./GameServer_d2 start & etc ... I have all 5 chanels
12-04-2013, 10:35 AM
So, I think you dont really need a script, but a simple cron job restarter that check your GS daemons every 5 minutes (you can choose the time) and restart them if theyre down. This simple link can help you to understand how to set-up automated tasks. 2 Enjoy ![]()
12-04-2013, 03:08 PM
So, I think you dont really need a script, but a simple cron job restarter that check your GS daemons every 5 minutes (you can choose the time) and restart them if theyre down. This simple link can help you to understand how to set-up automated tasks. 2 Enjoy ![]() Please can you tell me the "cron" ? how to add in this .sh ? #!/bin/sh cd /opt/7.GameServer/GameServer2 ./GameServer_d start &
12-04-2013, 03:45 PM
run2 #!/bin/bash while ( : ) do DATE=`date` if [ -r .shutdown ]; then rm -f .shutdown fi gdb --batch --command=cmd ./GameServer_d > "bt_`date +%y%m%d%H%M%S`.log" DATE2=`date` if [ -r .shutdown ]; then echo "***** Shutdown $DATE ~ $DATE2" >> rebootlog exit fi echo "!!!!! Reboot $DATE ~ $DATE2" >> rebootlog sleep 2 done cmd handle SIGPIPE nostop r echo "-------------------------------------------" echo "error--------------------------------------" echo "-------------------------------------------" thread echo "-------------------------------------------" echo "thread 1 - Game Thread---------------------" echo "-------------------------------------------" thread 1 bt full echo "-------------------------------------------" echo "thread 2 - Thread Library------------------" echo "-------------------------------------------" thread 2 bt full echo "-------------------------------------------" echo "thread 3 - DB Thread ----------------------" echo "-------------------------------------------" thread 3 bt full use these 2 files. Start with using run the cmd is just a command file for GDB if u dont have gdb: yum install gdb This will also make a debug log if the server crashes
12-04-2013, 04:13 PM
No such file or directory ./GameServer_d2
12-09-2013, 03:24 PM
Im made rs.sh for restarter in all gameserver folder and i got this error when started this .sh things... [root@222191 ~]# cd /opt/8.GameServer/GameServer2 [root@222191 GameServer2]# ./rs2.sh *** glibc detected *** /opt/8.GameServer/GameServer2/GameServer_d2: corrupted double-linked list: 0x088357c0 *** ======= Backtrace: ========= /lib/libc.so.6(+0x70df1)[0xb7d06df1] /lib/libc.so.6(+0x737e3)[0xb7d097e3] /usr/lib/libstdc++.so.6(_ZdlPv+0x22)[0xb7f21df2] /opt/8.GameServer/GameServer2/GameServer_d2[0x81e4c33] /opt/8.GameServer/GameServer2/GameServer_d2[0x81d19ba] /opt/8.GameServer/GameServer2/GameServer_d2[0x81d5367] /lib/libc.so.6(exit+0xdf)[0xb7cc410f] /opt/8.GameServer/GameServer2/GameServer_d2[0x81bbea6] /opt/8.GameServer/GameServer2/GameServer_d2[0x81c2501] /opt/8.GameServer/GameServer2/GameServer_d2[0x810719f] /lib/libc.so.6(__libc_start_main+0xe6)[0xb7cacce6] /opt/8.GameServer/GameServer2/GameServer_d2(__gxx_personality_v0+0xd9)[0x804aab1] ======= Memory map: ======== 08048000-0833f000 r-xp 00000000 90:6b 445513758 /opt/8.GameServer/GameServer2/GameServer_d2 0833f000-08342000 rw-p 002f7000 90:6b 445513758 /opt/8.GameServer/GameServer2/GameServer_d2 08342000-2e980000 rw-p 00000000 00:00 0 [heap] b675f000-b6760000 ---p 00000000 00:00 0 b6760000-b7160000 rwxp 00000000 00:00 0 b7160000-b7401000 rw-p 00000000 00:00 0 b7800000-b7821000 rw-p 00000000 00:00 0 b7821000-b7900000 ---p 00000000 00:00 0 b7a20000-b7a21000 rw-p 00000000 00:00 0 b7ab7000-b7bcc000 rw-p 00000000 00:00 0 b7bcc000-b7c15000 r-xp 00000000 90:6b 58654809 /lib/libfreebl3.so b7c15000-b7c16000 r--p 00048000 90:6b 58654809 /lib/libfreebl3.so b7c16000-b7c17000 rw-p 00049000 90:6b 58654809 /lib/libfreebl3.so b7c17000-b7c1b000 rw-p 00000000 00:00 0 b7c1b000-b7c30000 r-xp 00000000 90:6b 280497337 /lib/libresolv-2.12.so b7c30000-b7c31000 ---p 00015000 90:6b 280497337 /lib/libresolv-2.12.so b7c31000-b7c32000 r--p 00015000 90:6b 280497337 /lib/libresolv-2.12.so b7c32000-b7c33000 rw-p 00016000 90:6b 280497337 /lib/libresolv-2.12.so b7c33000-b7c35000 rw-p 00000000 00:00 0 b7c35000-b7c3a000 r-xp 00000000 90:6b 280497317 /lib/libnss_dns-2.12.so b7c3a000-b7c3b000 r--p 00004000 90:6b 280497317 /lib/libnss_dns-2.12.so b7c3b000-b7c3c000 rw-p 00005000 90:6b 280497317 /lib/libnss_dns-2.12.so b7c3c000-b7c48000 r-xp 00000000 90:6b 280497304 /lib/libnss_files-2.12.so b7c48000-b7c49000 r--p 0000b000 90:6b 280497304 /lib/libnss_files-2.12.so b7c49000-b7c4a000 rw-p 0000c000 90:6b 280497304 /lib/libnss_files-2.12.so b7c4a000-b7c4b000 rw-p 00000000 00:00 0 b7c4b000-b7c62000 r-xp 00000000 90:6b 280497278 /lib/libnsl-2.12.so b7c62000-b7c63000 r--p 00016000 90:6b 280497278 /lib/libnsl-2.12.so b7c63000-b7c64000 rw-p 00017000 90:6b 280497278 /lib/libnsl-2.12.so b7c64000-b7c66000 rw-p 00000000 00:00 0 b7c66000-b7c6d000 r-xp 00000000 90:6b 280497282 /lib/libcrypt-2.12.so b7c6d000-b7c6e000 r--p 00007000 90:6b 280497282 /lib/libcrypt-2.12.so b7c6e000-b7c6f000 rw-p 00008000 90:6b 280497282 /lib/libcrypt-2.12.so b7c6f000-b7c96000 rw-p 00000000 00:00 0 b7c96000-b7e26000 r-xp 00000000 90:6b 280497327 /lib/libc-2.12.so b7e26000-b7e27000 ---p 00190000 90:6b 280497327 /lib/libc-2.12.so b7e27000-b7e29000 r--p 00190000 90:6b 280497327 /lib/libc-2.12.so b7e29000-b7e2a000 rw-p 00192000 90:6b 280497327 /lib/libc-2.12.so b7e2a000-b7e2d000 rw-p 00000000 00:00 0 b7e2d000-b7e4a000 r-xp 00000000 90:6b 280497525 /lib/libgcc_s-4.4.7-20120601.so.1 b7e4a000-b7e4b000 rw-p 0001d000 90:6b 280497525 /lib/libgcc_s-4.4.7-20120601.so.1 b7e4b000-b7e73000 r-xp 00000000 90:6b 280497276 /lib/libm-2.12.so b7e73000-b7e74000 r--p 00027000 90:6b 280497276 /lib/libm-2.12.so b7e74000-b7e75000 rw-p 00028000 90:6b 280497276 /lib/libm-2.12.so b7e75000-b7f54000 r-xp 00000000 90:6b 280495764 /usr/lib/libstdc++.so.6.0.13 b7f54000-b7f58000 r--p 000de000 90:6b 280495764 /usr/lib/libstdc++.so.6.0.13 b7f58000-b7f59000 rw-p 000e2000 90:6b 280495764 /usr/lib/libstdc++.so.6.0.13 b7f59000-b7f61000 rw-p 00000000 00:00 0 b7f61000-b7f64000 r-xp 00000000 90:6b 280497335 /lib/libdl-2.12.so b7f64000-b7f65000 r--p 00002000 90:6b 280497335 /lib/libdl-2.12.so b7f65000-b7f66000 rw-p 00003000 90:6b 280497335 /lib/libdl-2.12.so b7f66000-b7f78000 r-xp 00000000 90:6b 58589338 /lib/libz.so.1.2.3 b7f78000-b7f79000 r--p 00011000 90:6b 58589338 /lib/libz.so.1.2.3 b7f79000-b7f7a000 rw-p 00012000 90:6b 58589338 /lib/libz.so.1.2.3 b7f7a000-b7fa9000 r-xp 00000000 90:6b 280496362 /usr/lib/libmysqlclient.so.12.0.0 b7fa9000-b7fbd000 rw-p 0002e000 90:6b 280496362 /usr/lib/libmysqlclient.so.12.0.0 b7fbd000-b7fd4000 r-xp 00000000 90:6b 280497296 /lib/libpthread-2.12.so b7fd4000-b7fd5000 r--p 00016000 90:6b 280497296 /lib/libpthread-2.12.so b7fd5000-b7fd6000 rw-p 00017000 90:6b 280497296 /lib/libpthread-2.12.so b7fd6000-b7fd8000 rw-p 00000000 00:00 0 b7fdd000-b7fdf000 rw-p 00000000 00:00 0 b7fdf000-b7fe0000 r-xp 00000000 00:00 0 [vdso] b7fe0000-b7ffe000 r-xp 00000000 90:6b 280497437 /lib/ld-2.12.so b7ffe000-b7fff000 r--p 0001d000 90:6b 280497437 /lib/ld-2.12.so b7fff000-b8000000 rw-p 0001e000 90:6b 280497437 /lib/ld-2.12.so bffeb000-c0000000 rwxp 00000000 00:00 0 [stack] Thread ID 3 not known. [root@222191 GameServer2]#
12-09-2013, 03:25 PM
In .rs.sh i have this: #!/bin/bash while ( : ) do DATE=`date` if [ -r .shutdown ]; then rm -f .shutdown fi gdb --batch --command=cmd ./GameServer_d > "bt_`date +%y%m%d%H%M%S`.log" DATE2=`date` if [ -r .shutdown ]; then echo "***** Shutdown $DATE ~ $DATE2" >> rebootlog exit fi echo "!!!!! Reboot $DATE ~ $DATE2" >> rebootlog sleep 2 done |
|
« Next Oldest | Next Newest »
|