Sign in to follow this  
Followers 0
enoanot

Probleme bei Start script für Linux

1 post in this topic

Hallo ich habe hier im Forum ein Start Script gefunden leider klappt es nicht.

Ich brauche das damit ich bei Linux per Cronejob ein Autostart machen kann.

Er startet das Script und dann kommt folgenes

" Setting Permission to neeses...

 Starting arma3server...

 Searching Process arma3server

 Error! Could not start arma3server!"

#!/bin/bash

### BEGIN INIT INFO
# Provides:		a3exileserver
# Required-Start:	$remote_fs $network
# Required-Stop:	$remote_fs $network
# Should-Start:	mysql
# Should-Stop:	mysql
# Default-Start:	2 3 4 5
# Default-Stop:	0 1 6
# Description:	ArmA 3 Exile init.d Script by Flodding
### END INIT INFO
#
#=======================================================================
#========               CONFIGURATION PARAMETERS                ========
#======== MUST BE EDITED MANUALLY TO FIT YOUR SYSTEM PARAMETERS ========
#=======================================================================

USERNAME=exile_omega
ARMA_DIR='/home/exile_omega/exiles'
NAME=config
CONFIGFOLDER=${ARMA_DIR}/config
CONFIG=${CONFIGFOLDER}/config.cfg
CFG=${CONFIGFOLDER}/basic.cfg
BEPATH=${CONFIGFOLDER}/battleye
PORT=2365
PIDFILE=${ARMA_DIR}/${PORT}.pid
SERVICE=arma3server
BACKUPPATH=/home/exile_omega/backup
CPU_COUNT=5
BACKUPDAYS=3
MODS=@exile"\;"@ryanzombies
#MODS=@allinarmaterrainpack"\;"@esseker"\;"@exile
SERVERMOD=@exileserver
OPTIONS="-port=${PORT} -pid=${PIDFILE} -cfg=${CFG} -config=${CONFIG} -name=${NAME} -mod=${MODS} -servermod=${SERVERMOD} -autoinit"

#=======================================================================

a3_start() {
  echo ""
  if [ ! -f $ARMA_DIR/$SERVICE ]
  then
    echo "$SERVICE not found! STOPPING !!!"
    echo ""
    sleep 1
    exit
  else
    if  pgrep -u $USERNAME -f $SERVICE > /dev/null
    then
      echo "$SERVICE is already running!"
      echo ""
    else
      echo "Setting Permissions to needed..."
      echo ""
	  chmod -R 0755 $ARMA_DIR
	  chown -R $USERNAME:$USERNAME /home/$USERNAME
      echo "Starting $SERVICE..."
      echo ""
         cd $ARMA_DIR
         su $USERNAME -c "screen -dmS $USERNAME ./$SERVICE $OPTIONS" > stdout.log 2> stderr.log &
      echo "Searching Process $SERVICE"
      echo ""
	  sleep 8
	  if pgrep -u $USERNAME -f $SERVICE > /dev/null
	  then
	    echo "$SERVICE is now running."
           echo ""
	  else
           echo "Error! Could not start $SERVICE!"
           echo ""
         fi
    fi
  fi
}

a3_stop() {
  echo ""
  if pgrep -u $USERNAME -f $SERVICE > /dev/null
  then
    echo "Stopping $SERVICE !!"
    echo ""
	killall -9 -u $USERNAME
  else
    echo "$SERVICE is stopped."
    echo ""
  fi
}


case "$1" in
  start)
    a3_start
    ;;
  stop)
    a3_stop

    if [ -f ${PIDFILE} ]; then
    rm -f ${PIDFILE}
    fi
    sleep 5s
    ;;
  restart)
    a3_stop
    a3_start
    ;;
  status)
    if [ -f ${PIDFILE} ]; then
      PID=$(< ${PIDFILE})
      echo "PID-File existiert (PID=${PID})..."
        if [ -f /proc/${PID}/cmdline ]; then
          echo "Server Prozess scheint zu laufen..."
        fi
      fi
    ;;

*)
echo "$0 (start|stop|restart|status)"
exit 1
;;
esac

exit 0

Ich hoffe ihr könnt mir helfen

Edited by enoanot

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.