Core neustarten

12/30/2014 14:45 1Fantasy1#1
Hallo Leute
Könnt ihr mir vlt helfen beim erstellen von automatischen core restarter?

Hier meine start.sh

#!/bin/sh
echo "***** wird gestartet..."
cd /home/game/g1/db && ./db & sleep 4
cd /home/game/g1/auth && ./auth & sleep 2
cd /home/game/channel1/core1 && ./game & sleep 2
cd /home/game/channel1/core2 && ./game & sleep 2
cd /home/game/channel1/core3 && ./game & sleep 2
cd /home/game/channel1/core4 && ./game & sleep 2
cd /home/game/channel1/core5 && ./game & sleep 2
cd /home/game/channel2/core1 && ./game & sleep 2
cd /home/game/channel2/core2 && ./game & sleep 2
cd /home/game/channel2/core3 && ./game & sleep 2
cd /home/game/channel2/core4 && ./game & sleep 2
cd /home/game/channel2/core5 && ./game & sleep 2
cd /home/game/game99/core1 && ./game & sleep 2
cd /home/game/game99/core2 && ./game & sleep 2
cd /home/game/game99/core3 && ./game & sleep 2
cd /home/game/game99/core4 && ./game & sleep 2
cd /home/game/game99/core5 && ./game & sleep 2
cd ..
sleep 2
echo "**** ist nun Online!"

würde mir sehr freuen
12/30/2014 16:56 Samael#2
PHP Code:
SERVICE='coreone'
START="./${SERVICE} &"
while ( : ) do
  if 
ps ax grep -v grep grep $SERVICE > /dev/null
  then
    true
  
else
    echo 
"$SERVICE wird gestartet..."
    
$START
  fi
  sleep 5
done 
kein support zur verwendung. Dies ist ein auto restart script für 1 core. auto.sh nennen, 0777 rechte geben und per start.sh ansteuern (cd ../../../../core1 && sh auto.sh)
12/30/2014 17:07 1Fantasy1#3
Quote:
Originally Posted by xSaito View Post
PHP Code:
SERVICE='coreone'
START="./${SERVICE} &"
while ( : ) do
  if 
ps ax grep -v grep grep $SERVICE > /dev/null
  then
    true
  
else
    echo 
"$SERVICE wird gestartet..."
    
$START
  fi
  sleep 5
done 
kein support zur verwendung. Dies ist ein auto restart script für 1 core. auto.sh nennen, 0777 rechte geben und per start.sh ansteuern (cd ../../../../core1 && sh auto.sh)
brauche aber für jeden core einen autostart kannst mir vlt helfen
12/30/2014 17:12 Samael#4
Quote:
Originally Posted by 1Fantasy1 View Post
brauche aber für jeden core einen autostart kannst mir vlt helfen
Wenn du 5 cores hast, legste die datei einfach 5 mal an und packst sie zu jeder core in den ordner. Ist doch logisch oder?
12/30/2014 17:21 1Fantasy1#5
funkt. nicht brauche noch hilfe

#push
12/30/2014 19:37 Lowpass#6
check.sh einfach den pfad und deine start sh eintragen und einen crontab drauf laufen lassen.

PHP Code:
#!/bin/sh

LPATH="/home/game2"


for i in `/usr/bin/find $LPATH -name pid` ; do
    
local_path=`echo $i | /usr/bin/sed -e 's/pid//g'`;
    
pid=`/bin/cat $i`
    
pr=`/bin/ps auxxww | /usr/bin/grep $pid | /usr/bin/grep -v grep`
      if [ -
"$pr]; then
        cd $local_path 
&& /home/game2/start.sh
    fi
done 
12/30/2014 19:48 1Fantasy1#7
der startet aber nicht die cores von alleine fals die abgestürtz sind
12/30/2014 19:54 Lowpass#8
doch macht er
12/30/2014 20:23 Samael#9
Quote:
Originally Posted by 1Fantasy1 View Post
funkt. nicht brauche noch hilfe

#push
funtzt wunderbar. Insofern man es richtig macht ;)