How to keep services and maps online!?

Results 1 to 11 of 11
  1. #1
    Banned LegalSin(scam) is offline
    BannedRank
    Dec 2011 Join Date
    RaGEZONELocation
    489Posts

    sad How to keep services and maps online!?

    service.sh
    PHP Code:
    #! /bin/sh
    while true
    do
        if (
    ps -ef|grep "monitor.sh"|grep -v grep>/dev/null)
        
    then 
               sleep 2
        
    else
        
    date
            cd $this_dir
            nohup 
    ./monitor.sh >/PWServer/authd.old/service.log 2>&&
            
    sleep 5
        fi
        sleep 2
    done 
    monitor.sh
    PHP Code:
    #! /bin/bash
    #CONFIGURATIONS:
    #======MAPS======
    MAPS=('gs01' 'is01' 'is02' 'is05' 'is06' 'is07' 'is08' 'is09' 'is10' 'is11' 'is12' 'is13' 'is14' 'is15' 'is16' 'is17' 'is18' 'is19' 'is20' 'is21' 'is22' 'is23' 'is24' 'is25' 'is26' 'is27' 'is28' 'is29' 'is31' 'is32' 'is33' 'is34' 'is35' 'is38' 'is39' 'is37' 'is40' 'arena01' 'arena02' 'arena03' 'arena04' 'bg01' 'bg02' 'bg03' 'bg04' 'bg05' 'bg06');

    #======DAEMONS======
    DAEMONS=('logservice' 'gamedbd' 'glinkd' 'gfactiond' 'gdeliveryd' 'uniquenamed' 'gacd' 'authd');
    #=====================================Script=====================================
    #
    C_MAPS=44
    while [ "ture" == "ture" ];
    do

    for 
    i in ${MAPS[@]}
        do 
                if (
    ps -ef|grep "$i"|grep -v grep >/dev/null)
                
    then
                    err
    =$(expr $err 0)
                    
    sleep 1
                
    else
                    
    printf "$i: Is Dead And Gone! , Initiate the Startup process of $i....\n"
                    
    cd /PWServer/gamed/
                    
    nohup ./gs $i >/PWServer/logs/$i.log 2>&&
                    
    cd /root/
                                if (
    ps -ef|grep "$i"|grep -v grep >/dev/null)
                                
    then
                                printf 
    "Map $i: Started Up!.\n"
                                
    printf "Program Timer Update:$(date). Number of Errors:$(expr $err - $C_MAPS).\n";
                                
    err=$(expr $err 1)
                                else
                                
    printf "Map $i: is Still Down!.\n"
                                
    printf "Program Timer Update:$(date). Number of Errors:$(expr $err - $C_MAPS).\n";
                                
    err=$(expr $err 1)
                                
    fi
                    sleep 1
                fi
    done

    for r in ${DAEMONS[@]}
        do 
                if (
    ps -ef|grep "$r"|grep -v grep >/dev/null)
                
    then
                    err
    =$(expr $err 0)
                    
    sleep 1
                
    else
                    
    printf "$r: Is Dead And Gone! , Initiate the Startup process of $r....\n"
                            
    if [ "$r"glinkd" ]
                            
    then
                                cd 
    /PWServer/$r
                                nohup 
    ./$r gamesys.conf 1 >/PWServer/logs/$r.log 2>&&
                                
    nohup ./$r gamesys.conf 2 >/PWServer/logs/$r.log 2>&&
                            
    elif "$r"logservice" ]
                            
    then
                                cd 
    /PWServer/build/
                                
    nohup ./$r >/PWServer/logs/authd.log 2>&&

                            
    elif "$r"authd" ]
                            
    then
                                cd 
    /PWServer/$r/build
                                nohup 
    ./$r >/PWServer/logs/$r.log 2>&&
                            
                            else
                                
    cd /PWServer/$r
                                nohup 
    ./$r gamesys.conf >/PWServer/logs/$r.log 2>&&
                            
    fi        
                                
    if (ps -ef|grep "$r"|grep -v grep >/dev/null)
                                
    then
                                printf 
    "DAEMON $r: Started Up!.\n"
                                
    printf "Program Timer Update:$(date). Number of Errors:$(expr $err - $C_MAPS).\n";
                                
    err=$(expr $err 1)
                                else
                                
    printf "DAEMON $r: is Still Down!.\n"
                                
    err=$(expr $err 1)
                                
    printf "Program Timer Update:$(date). Number of Errors:$(expr $err - $C_MAPS).\n";
                                
    fi
                    cd 
    /root/
                    
    sleep 1
                    fi
    done

    done 
    This script its 100% tested for bugs.


  2. #2
    Account Upgraded | Title Enabled! sxymxd84 is offline
    MemberRank
    Aug 2004 Join Date
    ArizonaLocation
    612Posts

    Re: How to keep services and maps online!?

    if its 100% tested are you sharing or asking for help? -_- your not making yourself clear. Your thread title says one things, your post says another. Which is it.

    There are more than 100 things that can keep authd and maps offline.

  3. #3
    SHM - Swedish House Mafia 80085 is offline
    MemberRank
    Nov 2011 Join Date
    N/ALocation
    229Posts

    Re: How to keep services and maps online!?

    So I guess this is a script that auto turn on authd and maps when they are directly gets offline?

  4. #4
    Robb rbb138 is offline
    MemberRank
    Jan 2009 Join Date
    London, EnglandLocation
    1,241Posts

    Re: How to keep services and maps online!?

    It's best to use the offical one in the serverpack.

  5. #5
    Banned LegalSin(scam) is offline
    BannedRank
    Dec 2011 Join Date
    RaGEZONELocation
    489Posts

    Re: How to keep services and maps online!?

    you start the server normal like you always do then you run the script after

    but you need to :D edit it a bit.

  6. #6
    Proficient Member michae5k is offline
    MemberRank
    Jan 2009 Join Date
    LondonLocation
    177Posts

    Re: How to keep services and maps online!?

    I personally would use the "servicerun" daemon included with the PWI files as Robb suggested :)
    but for new comers i guess this is good.

  7. #7
    Angelemu founder tbnanubis is offline
    MemberRank
    Mar 2011 Join Date
    Unicorn ForestLocation
    527Posts

    Re: How to keep services and maps online!?

    I don't see a point in this, as those services NEVER crash. And if they ever would, i'd rather figure that out myself and have the chance to see when it happened and figure out why.

  8. #8
    Apprentice Knowledge is offline
    MemberRank
    Jun 2012 Join Date
    9Posts

    Re: How to keep services and maps online!?

    People have been able to keep their servers on for years without the help of this script. It's not like this is anything new. Secondly, I seriously don't see how the hell you are still allowed on these forums.

  9. #9
    Account Upgraded | Title Enabled! sxymxd84 is offline
    MemberRank
    Aug 2004 Join Date
    ArizonaLocation
    612Posts

    Re: How to keep services and maps online!?

    Besides one can easily make a cron to check and restart maps if needed anyways. This script can be dangerous. Lets use our brains and keep things secure.

  10. #10
    Banned LegalSin(scam) is offline
    BannedRank
    Dec 2011 Join Date
    RaGEZONELocation
    489Posts

    Re: How to keep services and maps online!?

    Quote Originally Posted by sxymxd84 View Post
    Besides one can easily make a cron to check and restart maps if needed anyways. This script can be dangerous. Lets use our brains and keep things secure.
    can be dangerous??

    Explain?

  11. #11
    dev gunse is offline
    MemberRank
    Mar 2009 Join Date
    IndonesiaLocation
    476Posts

    Re: How to keep services and maps online!?

    I'm 100% agree with tbnanubis :D

    Quote Originally Posted by LegalSin View Post
    can be dangerous??

    Explain?
    Easy to create dups item...



Advertisement