Jump to content
Viral.BadKarma

Running as a service on linux

Recommended Posts

Hi all,

  I'm not very good with linux yet, and I'm having an issue with running the dedi linux server:

15:48:39 No product.bin found, using defaults for a core engine.
szCmd: /bin/sh -c '"/home/arma3/arma3/steam/steam.sh" "steam://run/107410//%22-$
15:48:39 Unable to locate a running instance of Steam. Restarting...
15:48:39 ../lib/Network/networkServer.cpp ClearNetServer:NOT IMPLEMENTED - brie$
/bin/sh: 1: /home/arma3/arma3/steam/steam.sh: not found
Unable to locate a running instance of Steam
15:48:39 Extensions:
 
is generated in the logs when I run via service nameofservice start
I don't get any errors if i run start.sh directly?
 
/etc/init.d/Arma3Server
#!/bin/sh
#Init Script For Arma3Server Private


#Directory where Arma3Server config files will live.
SERVERFOLDER=/home/arma3/arma3/private
#Path to the start.sh
STARTSH=$SERVERFOLDER/start.sh
SERVERSTATUS=$SERVERFOLDER/ARMA3Server.pid
USERNAME=arma3server
#If your user is system user, a shell needs to be specified.  Otherwise, set this to an empty string
USERSHELL="-s /bin/sh"
GAMEPORT=2312

. /lib/lsb/init-functions

case $1 in
    start)
        log_daemon_msg "Starting ARMA 3 PrivateServer" "arma3server"
        su $USERNAME -c "$STARTSH -f -d" $USERSHELL
                sudo netstat -tulpn | grep :$GAMEPORT > $SERVERSTATUS


        log_end_msg 0
    ;;
    stop)
        log_daemon_msg "Stopping Arma 3 PrivateServer" "arma3server"
                rm $SERVERSTATUS
        log_end_msg 0
    ;;
    restart)
        log_daemon_msg "Restarting Arma 3 PrivateServer" "arma3server"
        #Stop
                rm $SERVERSTATUS
        #Start
        su $USERNAME -c "$STARTSH -f -d" $USERSHELL
                sudo netstat -tulpn | grep :$GAMEPORT > $SERVERSTATUS
        log_end_msg 0
    ;;
    status)
        PID=`cat $SERVERSTATUS`
        if [ -n "$PID" ]; then
            log_success_msg "Arma 3 Private Server is running (pid $PID)."
            exit 0
        else
            log_failure_msg "Arma 3 Private Server is not running."
            exit 1
        fi
    ;;
    *)
        log_success_msg "Usage: $0 {start|stop|restart|status}"
        exit 1
    ;;
esac

start.sh

 

#!/bin/bash
#Wrapper file to start the a3 server

serverDir="/home/arma3/arma3/private"

#logs
serverLogDir="$serverDir/Logs"

#Server Installation path
serverConfigDir="$serverDir/serverconfig"

#Network settings used in -cfg param
networkConfig="$serverConfigDir/basic.cfg"

#Server configuration settings used in -config param
serverConfig="$serverConfigDir/server.cfg"

#server profile and idfficulty settings used in -name param
profileName="public"

#Server-side mods
servermods="mods/@ExileServer"
mods="mods/@Exile"


#Start server
"$serverDir/arma3server" -port=2312 -cfg="/$networkConfig" -config="$serverConfig" -name="profileName" -mod="${mods}" -servermod="${servermods}" -autoinit -noSound -netlog="$serverLogDir"/netlog.txt 1>> "$serverLogDir"/Log.txt 2>>"$serverLogDir"/Log.txt
 

 

 

 

 

Some of my misguided research has pointed me towards steam.sh vs steamcmd.sh??

 

 

Thanks

Share this post


Link to post
Share on other sites

szCmd: /bin/sh -c '"/home/arma3/arma3/steam/steam.sh" "steam://run/107410//%22-$

This seems to be part of it no?  i've edited the init.d file to take /bin/sh -c out...but its still executing the "old" copy??

 #If your user is system user, a shell needs to be specified.  Otherwise, set this to an empty string

#USERSHELL="-s /bin/sh"
USERSHELL=""
 
 
do you have to systemctl or something to get it to update?

Share this post


Link to post
Share on other sites

I have a ubuntu linux vps and struggled with managing server and found this really good utility that took the headache out of server managing. Its called Linux game server managers and link for it below. It automatically installs, runs server in background, controls start, stop, restart, etc also great features such as monitoring, alerts, etc. Hope this helps. :) 

 

https://gameservermanagers.com/lgsm/arma3server/

Share this post


Link to post
Share on other sites

Thanks, but i think i held off from that because you couldn't run multiple instances at the same time? or am i wrong there?

 

That and using it as an excuse to learn how to trouble shoot in linux.

Share this post


Link to post
Share on other sites

just use upstart 

 

Simple and functional 

# Arma 3 Server Instance

description "Arma 3 Server Instance"
author "Arma 3 Server Instance"

# When to start the service
start on stopped arma3update

# When to stop the service
stop on runlevel [016]

# Specify working directory
chdir /home/arma3server/steamcmd/arma3

# Automatically restart process if crashed
respawn limit 3 10

# Specify the process/command to start

script
sleep 30
exec sudo -u arma3server taskset 0,1,2,3 ./arma3server -name=Server -config=startup/server.cfg -exThreads=1 -enableHT

end script

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×