Forum

ASSIST, AMERICA'S ARMY COMMUNITY - RELIVE THE GLORY DAYS OF AMERICA'S ARMY 2.5

Author Topic: AA:ASSIST - Server Restart Script Needed - Linux  (Read 3147 times)

0 Members and 1 Guest are viewing this topic.

Offline Kuschizzza

AA:ASSIST - Server Restart Script Needed - Linux
« on: Thursday, April 10, 2014, 16:39:28 PM »
Hello Guys,

I need a server restart script for my americas army server. It should automatically restart my server if my "root server are going for reboot or something" and restart after crash.

Is it possible to get it from someone? It's for Linux (Debian)

Thanks a lot !

Offline [SWISS]Merlin

Re: AA:ASSIST - Server Restart Script Needed - Linux
« Reply #1 on: Friday, April 11, 2014, 05:37:25 AM »
sorry, i made them only for windows.
« Last Edit: Friday, August 22, 2014, 19:09:17 PM by [SWISS]Merlin »

Offline Kuschizzza

Re: AA:ASSIST - Server Restart Script Needed - Linux
« Reply #2 on: Sunday, April 13, 2014, 13:05:25 PM »
damn I need it for Debian

Offline BiG_SerGiO

  • Administrator
  • Epic Poster
  • *
  • Posts: 2,232
  • "I got soul but i'm not a soldier..."
    • View Profile
    • Portuguese Warriors
  • AA: [PTwars]b!6
Re: AA:ASSIST - Server Restart Script Needed - Linux
« Reply #3 on: Sunday, April 13, 2014, 14:44:18 PM »
Have you tried an expert debian forum? I bet they might have solution for that. Try googling.
"Three things can not hide for long: the Moon, the Sun and the Truth"?
Hmm?

https://vortexservers.com/clients/aff.php?aff=406

Offline Petrol

Re: AA:ASSIST - Server Restart Script Needed - Linux
« Reply #4 on: Monday, April 14, 2014, 03:12:46 AM »

Offline OICURMT2!

Re: AA:ASSIST - Server Restart Script Needed - Linux
« Reply #5 on: Tuesday, April 15, 2014, 08:27:56 AM »
Hello Guys,

I need a server restart script for my americas army server. It should automatically restart my server if my "root server are going for reboot or something" and restart after crash.

Is it possible to get it from someone? It's for Linux (Debian)

Thanks a lot !

fyi

if you do decide to issue a start command in the rc3.d directory (as a link to init.d), then you need to serious consider what system commands you use, as there could be security issues.

I'd opt for crontab as a user that only has access to the 25Assist binary, cron'd every two minutes that check the server and then restarts it if the server binary is missing. 

OIC!
--
Oh, I See You Are Empty Too !

Offline 82nd_DXO_COL=Shad

Re: AA:ASSIST - Server Restart Script Needed - Linux
« Reply #6 on: Friday, August 22, 2014, 13:25:36 PM »
For anyone that runs linux servers.
This assumes you know about sysV init styles and bash shells.  I don't guarantee this to work (mine actually have a lot more stuff) but it should give you some ideas for creating your own scripts.  I run multiple servers (naming scheme armyops25_1, armyops25_2, ect) and have multiple /etc/init.d startup scripts for each.  Make sure you configure them to run at boot (chkconfig --add).  This is from redhat/centos.  I don't know if Debian uses a source function include file (. /etc/rc.d/init.d/functions) or not nor do I know if the latest distros still use SysV style (/etc/init.d, /etc/rc.d, chkconfig, ect.) init scripts.

Code: [Select]
#!/bin/bash
#
# chkconfig: 345 73 73
# description: Starts ArmyOps server

# Source function library.
. /etc/rc.d/init.d/functions

#procid=$$
# wherever you store the assist folder for each game.  Some things can be soft linked if you are space conscious
[ -f /usr/local/bin/armyops25_1/System/server-bin ] || exit 0
prog="/usr/local/bin/armyops25_1/System/server-bin"
rport=1948
args="GLOBAL Pipeline_SF "
timestamp=$(date +"%m%d%y-%H%M")
RETVAL=0
# See how we were called.
case "$1" in
  start)
        cd /usr/local/bin/armyops25_1/System
       #save previous log.  Use a logrotate cron if you need to
        cp aa25.log Logs/armyops25_1-aa25.log.$timestamp
        cp aa25srv.log Logs/armyops25_1-aa25srv.log.$timestamp
        echo -n "Starting ArmyOps Server 1 on port $rport: "
        $prog $args>/dev/null 2>&1 &
        sleep 1
        procid=$( pidof -s /usr/local/bin/armyops25_1/System/server-bin )
        if [ $procid ]
        then
         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/armyops25_1
         echo_success
         echo
         echo $procid > /var/run/armyops25_1.pid
         #give cpu priority to servers if you need to
         renice -1 $procid >/dev/null 2>&1
         procid=$( pidof -s  /usr/local/bin/armyops25_1/System/serverx )
         renice -1 $procid >/dev/null 2>&1
        else
         echo_failure
        fi
        ;;
  stop)
        echo -n "Stopping ArmyOps Server 1: "
        procid=`pgrep -f wtport=9023`
        if [[ $procid ]]
        then
         kill $procid
        fi
#  kill the three armyops25 processes
        procid=`pgrep -f '/usr/local/bin/armyops25_1/System/server-bin'`
        if [[ $procid ]]
        then
         kill -9 $procid
         unset -v procid
        fi
        procid=`pgrep -f  LD_LIBRARY_PATH=/usr/local/bin/armyops25_1`
        if [[ $procid ]]
        then
         kill -9 $procid
         unset -v procid
        fi
        procid=`pgrep -f /usr/local/bin/armyops25_1/System/serverx`
        if [[ $procid ]]
        then
         kill -9 $procid
         unset -v procid
        fi
        [ $RETVAL -eq 0 ] && rm -f /var/run/armyops25_1.pid
        if [ $RETVAL -eq 0 ]
        then
         echo_success
         echo
        else
         echo_failure
         echo
        fi
        ;;
  restart|reload)
        $0 stop
        sleep 5
        $0 start
        RETVAL=$?
        ;;
  *)
        echo "Usage: armyops {start|stop|restart}"
        exit 1
esac
exit $RETVAL
« Last Edit: Friday, August 22, 2014, 13:35:33 PM by 82nd_DXO_COL=Shad »

 

Download Assist

×

Download Game Client

Important: Battletracker no longer exists. However, old Battletracker accounts may still work. You can create a new 25Assist account here

Download Server Manager