daemon should now work.

- added daemon config
- daemon can be executed as root (but will run commands as steam user)
- daemon saves logs to the same directory of manager
This commit is contained in:
FezVrasta 2015-06-18 13:23:29 +02:00
parent 31b5fc3a4f
commit 1639a58e37
3 changed files with 14 additions and 3 deletions

View File

@ -1,13 +1,18 @@
#!/bin/bash
# Global variables
source /etc/arkdaemon.cfg
source /home/${steamuser}/.arkmanager.cfg
NAME=arkmanager_daemon
DESC="ARK manager daemon used to start the server and keep it updated"
PIDFILE="/var/run/${NAME}.pid"
LOGFILE="/var/log/${NAME}.log"
LOGFILE="${logdir}/${NAME}.log"
DAEMON="sh /usr/bin/arkmanager daemon"
START_OPTS="--start --background --make-pidfile --pidfile ${PIDFILE} --exec ${DAEMON}"
DAEMON="sh /usr/bin/arkmanager update"
START_OPTS="--start --background --make-pidfile --pidfile ${PIDFILE} --exec ${DAEMON} --user=${steamuser}"
STOP_OPTS="--stop --pidfile ${PIDFILE}"
test -x $DAEMON || exit 0

2
tools/arkdaemon.cfg Normal file
View File

@ -0,0 +1,2 @@
# user of your steamcmd and ARK server instance (don't use root!)
steamuser =

View File

@ -17,6 +17,10 @@ if [ ! -z $1 ]; then
mv arkmanager.cfg /home/$1/.arkmanager.cfg
chown $1 /home/$1/.arkmanager.cfg
# Copy arkdaemon.cfg inside /etc folder
mv arkdaemon.cfg /etc/arkdaemon.cfg
chown $1 /etc/arkdaemon.cfg
echo ${1} >> /etc/arkdaemon.cfg
else
echo "You must specify your steam user to install ARK Tools. Usage: ./install.sh steam"